Adds in some missing script functions that let projectiles damage and destroy physics shapes.

This commit is contained in:
Areloch 2016-04-26 11:30:24 -05:00
parent bab55d46a9
commit c645475e56
3 changed files with 83 additions and 0 deletions

View file

@ -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
//-----------------------------------------------------------------------------