mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Adds in some missing script functions that let projectiles damage and destroy physics shapes.
This commit is contained in:
parent
bab55d46a9
commit
c645475e56
3 changed files with 83 additions and 0 deletions
|
|
@ -97,6 +97,20 @@ function ShapeBase::clearDamageDt(%this)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
function GameBase::damage(%this, %sourceObject, %position, %damage, %damageType)
|
||||
{
|
||||
// All damage applied by one object to another should go through this method.
|
||||
// This function is provided to allow objects some chance of overriding or
|
||||
// processing damage values and types. As opposed to having weapons call
|
||||
// ShapeBase::applyDamage directly. Damage is redirected to the datablock,
|
||||
// this is standard procedure for many built in callbacks.
|
||||
|
||||
%datablock = %this.getDataBlock();
|
||||
if ( isObject( %datablock ) )
|
||||
%datablock.damage(%this, %sourceObject, %position, %damage, %damageType);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ShapeBase datablock
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue