[CF-Devel] Patch: new sound proposal
crossfire-devel at archives.real-time.com
crossfire-devel at archives.real-time.com
Thu May 20 02:20:06 CDT 2004
Nicolas Weeger wrote:
>>
But that actually isn't true. Since copy_object() copies the sound
>>
information, and since anything that is generated on the map after
>>
loading involves copy_object(), all those objects will now have sound
>>
information which is the same as the archetype, but because sound_info
>>
is now set, will get saved out. That isn't terrible, but is a bit odd.
>
>
>
Well, it isn't nice, but soundinfo gets cleared in loader.[lc].
>
Just after doing a copy_object, there's a free_soundinfo_for_object( tmp );
>
Actually, the copy in copy_object is there only for the loading of
>
archetypes, i think - since an object is first loaded, then copied as
>
arch.clone, we need to copy sound info at that point.
But I'm thinking of things like generators. Generators have other_arch set.
When that monster is created from a generator, the calls that are used to create
it will not free the sound information.
Same would actually be true for the treasure code for that matter. So the
only sound info that is getting cleared is that that is in the map file. All
items generated after the fact, unless copies from the map (eg, black puddings
perhaps) will have the full sound info, because it won't get freed, so it will
get saved out to disk.
A better approach than this is really needed. As said previously, it should
be pretty easy to add a flag saying 'this sound is unmodified from the
archetype, and just points at that sound data' vs a 'this sound is customized'.
_______________________________________________
crossfire-devel mailing list
crossfire-devel at lists.real-time.com
https://mailman.real-time.com/mailman/listinfo/crossfire-devel
More information about the crossfire
mailing list