- fixed compilation.

This commit is contained in:
Christoph Oelckers 2017-01-16 10:23:26 +01:00
parent cd0d17dbd5
commit cd1d96b83a
4 changed files with 12 additions and 2 deletions

View File

@ -699,6 +699,15 @@ void AInventory::AbsorbDamage (int damage, FName damageType, int &newdamage)
{ {
} }
DEFINE_ACTION_FUNCTION(AInventory, AbsorbDamage)
{
PARAM_SELF_PROLOGUE(AInventory);
PARAM_INT(damage);
PARAM_NAME(type);
PARAM_POINTER(newdmg, int);
self->AbsorbDamage(damage, type, *newdmg);
return 0;
}
//=========================================================================== //===========================================================================
// //
// AInventory :: ModifyDamage // AInventory :: ModifyDamage

View File

@ -1385,7 +1385,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da
if (!(flags & (DMG_NO_ARMOR|DMG_FORCED)) && target->Inventory != NULL && damage > 0) if (!(flags & (DMG_NO_ARMOR|DMG_FORCED)) && target->Inventory != NULL && damage > 0)
{ {
int newdam = damage; int newdam = damage;
newdam = target->AbsorbDamage damage, mod); newdam = target->AbsorbDamage(damage, mod);
damage = newdam; damage = newdam;
if (damage <= 0) if (damage <= 0)
{ {

View File

@ -3621,7 +3621,7 @@ int AActor::AbsorbDamage(int damage, FName dmgtype)
{ {
IFVIRTUALPTR(item, AInventory, AbsorbDamage) IFVIRTUALPTR(item, AInventory, AbsorbDamage)
{ {
VMValue params[4] = { (item, damage, dmgtype.GetIndex(), &damage }; VMValue params[4] = { item, damage, dmgtype.GetIndex(), &damage };
GlobalVMStack.Call(func, params, 4, nullptr, 0, nullptr); GlobalVMStack.Call(func, params, 4, nullptr, 0, nullptr);
} }
else item->AbsorbDamage(damage, dmgtype, damage); else item->AbsorbDamage(damage, dmgtype, damage);

View File

@ -39,6 +39,7 @@ class Inventory : Actor native
virtual native void AttachToOwner(Actor user); virtual native void AttachToOwner(Actor user);
virtual native void DetachFromOwner(); virtual native void DetachFromOwner();
virtual native bool DrawPowerup(int x, int y); virtual native bool DrawPowerup(int x, int y);
virtual native void AbsorbDamage (int damage, Name damageType, out int newdamage);
//=========================================================================== //===========================================================================
// //