Dead player comes back to live
by Thomas Huehn · in Torque Game Engine · 04/23/2007 (5:06 pm) · 1 replies
Some days ago i changed the %obj.setRepairRate(0); to %obj.setRepairRate(%this.repairRate / 63); in the script and all seams to work fine. Until i found out something is wrong and i didnt see why - i changed a lot since i set the repairrate ;)
After some debugging, i found out it has something to do with the mDamageState and the state did change from disable to enabled - enabled with a dead player ....
Maybe a bug (used 1.5) - maybe its because i added some stuff to shapeBase/player but the player repairs also if state="dead" and that caused strange behavior.
After I changed the statement in shapeBase.cc (processTick) from
if (mDataBlock->isInvincible == false )
to
if (mDataBlock->isInvincible == false && mDamageState == Enabled)
all works fine again - i hope ;)
Maybe somebody got the same strange behavior - and my post helps a little ..
greetings
thomas
After some debugging, i found out it has something to do with the mDamageState and the state did change from disable to enabled - enabled with a dead player ....
Maybe a bug (used 1.5) - maybe its because i added some stuff to shapeBase/player but the player repairs also if state="dead" and that caused strange behavior.
After I changed the statement in shapeBase.cc (processTick) from
if (mDataBlock->isInvincible == false )
to
if (mDataBlock->isInvincible == false && mDamageState == Enabled)
all works fine again - i hope ;)
Maybe somebody got the same strange behavior - and my post helps a little ..
greetings
thomas
About the author
Contact: torque [AT] ohmtal [DOT] com
Torque Owner Tim Heldna
I managed to fix it in script but can't remember exactly what I did. I think it had something to do with making sure the objects repair rate was reset to 0 at the right time.