ExplosionData Datablocks make TGE explode - fix
by Paul Scott · in Torque Game Engine · 06/20/2004 (1:11 am) · 1 replies
This is a one liner fixe for a looong standing bug.
On any platform, in the HEAD version of TGE, and likely TSE, for as long as I can recall,
When you inspect an ExplosionData datablock, whether using block.dump(), or clicking one in tree(), the engine crashes.
Took a while to track this one down. The old shockwave code was ripped out of Torque, as I recall, at Sierra's request. The ripping was not done well, and left some killer cruft.
This crashbug at first appears to be caused by the get/set funcs for TypeExplosionDataPtr resolving to null. Took me forever to figure out why a 27 was turning into a 26 over a function call...
The problem is that the ExplosionData structure has a spurious ShockwaveData in it, exposed to the console. When the console wants to examine an object, it uses some special get/set functions to do so. With the shockwave code ripped out, those get/set funcs arent there anymore, so the console merrily follows a function pointer to &0x0, and so crashes.
There are a couple of ways to fix this, may the TGE implementors use their best judgement.
Here's the easiest fix:
in explosion.cc , around line 168, cut or comment out the following line:
Removing that line will fix the crash.
Ye with CVS Access, may want to remove all other references to shockwaves, or change them all to strings or somesuch, for safety's sake.
Share and enjoy
On any platform, in the HEAD version of TGE, and likely TSE, for as long as I can recall,
When you inspect an ExplosionData datablock, whether using block.dump(), or clicking one in tree(), the engine crashes.
Took a while to track this one down. The old shockwave code was ripped out of Torque, as I recall, at Sierra's request. The ripping was not done well, and left some killer cruft.
This crashbug at first appears to be caused by the get/set funcs for TypeExplosionDataPtr resolving to null. Took me forever to figure out why a 27 was turning into a 26 over a function call...
The problem is that the ExplosionData structure has a spurious ShockwaveData in it, exposed to the console. When the console wants to examine an object, it uses some special get/set functions to do so. With the shockwave code ripped out, those get/set funcs arent there anymore, so the console merrily follows a function pointer to &0x0, and so crashes.
There are a couple of ways to fix this, may the TGE implementors use their best judgement.
Here's the easiest fix:
in explosion.cc , around line 168, cut or comment out the following line:
addField("shockwave", TypeShockwaveDataPtr, Offset(shockwave, ExplosionData));Removing that line will fix the crash.
Ye with CVS Access, may want to remove all other references to shockwaves, or change them all to strings or somesuch, for safety's sake.
Share and enjoy
Torque Owner Gonzo T. Clown
Or better yet, how about fixing the shockwave code so everyone can use it? Just a thought.