mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 09:04:38 +00:00
handle enabled->disabled->destroyed filters properly
This commit is contained in:
parent
9007aa9532
commit
860ac41181
1 changed files with 5 additions and 5 deletions
|
|
@ -177,7 +177,7 @@ function ShapeBaseData::setDamageDirection(%this, %obj, %sourceObject, %damagePo
|
||||||
|
|
||||||
function ShapeBaseData::onCollision(%this, %obj, %collObj, %vec, %len )
|
function ShapeBaseData::onCollision(%this, %obj, %collObj, %vec, %len )
|
||||||
{
|
{
|
||||||
if ((!isObject(%obj) || %obj.getDamageState() !$= "Enabled"))
|
if (!isObject(%obj) || %obj.getDamageState() $= "Destroyed")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//echo(%this SPC %obj SPC %collObj SPC %vec SPC %len );
|
//echo(%this SPC %obj SPC %collObj SPC %vec SPC %len );
|
||||||
|
|
@ -189,7 +189,7 @@ function ShapeBaseData::onCollision(%this, %obj, %collObj, %vec, %len )
|
||||||
|
|
||||||
function ShapeBaseData::onImpact(%this, %obj, %collObj, %vec, %len )
|
function ShapeBaseData::onImpact(%this, %obj, %collObj, %vec, %len )
|
||||||
{
|
{
|
||||||
if ((!isObject(%obj) || %obj.getDamageState() !$= "Enabled"))
|
if (!isObject(%obj) || %obj.getDamageState() $= "Destroyed")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//echo(%this SPC %obj SPC %collObj SPC %vec SPC %len );
|
//echo(%this SPC %obj SPC %collObj SPC %vec SPC %len );
|
||||||
|
|
@ -203,7 +203,7 @@ function ShapeBaseData::onImpact(%this, %obj, %collObj, %vec, %len )
|
||||||
|
|
||||||
function ShapeBaseData::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
|
function ShapeBaseData::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
|
||||||
{
|
{
|
||||||
if (!isObject(%obj) || %obj.getDamageState() !$= "Enabled" || !%damage)
|
if (!isObject(%obj) || %obj.getDamageState() $= "Destroyed" || !%damage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
%rootObj = %obj;
|
%rootObj = %obj;
|
||||||
|
|
@ -222,7 +222,7 @@ function ShapeBaseData::damage(%this, %obj, %sourceObject, %position, %damage, %
|
||||||
|
|
||||||
if (isObject(%client))
|
if (isObject(%client))
|
||||||
{
|
{
|
||||||
if (%rootObj.getDamageState() !$= "Enabled")
|
if (%obj.getDamageState() $= "Destroyed")
|
||||||
{
|
{
|
||||||
callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, "");
|
callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, "");
|
||||||
}
|
}
|
||||||
|
|
@ -233,7 +233,7 @@ function ShapeBaseData::onDamage(%this, %obj, %delta)
|
||||||
{
|
{
|
||||||
// This method is invoked by the ShapeBase code whenever the
|
// This method is invoked by the ShapeBase code whenever the
|
||||||
// object's damage level changes.
|
// object's damage level changes.
|
||||||
if (%delta > 0 && %obj.getDamageState() $= "Enabled")
|
if (%delta > 0 && %obj.getDamageState() !$= "Destroyed")
|
||||||
{
|
{
|
||||||
// Apply a damage flash
|
// Apply a damage flash
|
||||||
%obj.setDamageFlash(1);
|
%obj.setDamageFlash(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue