VoxelAnimTypeClass::ShareSource keeps stale pointers

Bug #896289 reported by DCoder DCoder
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ares
Confirmed
Medium
Unassigned

Bug Description

TechnoTypeClass::LoadFromINI reads the object's info from a given rules-ish file (rules, gamemode, map). If the ini file contains the [object] section, and the object is Voxel=yes, it calls ObjectTypeClass::Load3DArt, which unloads the voxels associated with this object and reloads them. Naturally, the reloaded data will exist in a different memory location. (Even if the files are the same as they were in the last file, let's reload them anyway! Loading times? Pshaw.)

VoxelAnimTypeClass::LoadFromINI takes the voxel from ShareSource and saves a pointer to it into this Voxel Anim. But if the Voxel Anim's section is not in the current rules-ish file, this function won't run - the Voxel Anim will keep a pointer to the old voxel file content, which possibly doesn't exist anymore.

##### STEPS TO REPRODUCE #####
rulesmd.ini:[SomeVoxelAnim]
ShareBodyData=yes
ShareSource=MTNK

gamemode ini/map code:[MTNK]
Something=Something

##### ADDITIONAL INFORMATION #####
All maps in the singleplayer campaigns already redefine MTNK, LTNK and HTNK to have BuildTimeMultiplier=1.0. Hence this bug is practically guaranteed when VoxelAnims are ShareSource'ing those units.

Insanity is fun.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.