Don't track fall damage if monster fall damage is disabled.
This commit is contained in:
parent
632c99b21c
commit
591e9dcf28
3 changed files with 33 additions and 5 deletions
|
|
@ -189,6 +189,7 @@ Class SWWMDamageAccumulator : Inventory
|
|||
Class SWWMWhoPushedMe : Inventory
|
||||
{
|
||||
Actor instigator;
|
||||
int killtimer;
|
||||
|
||||
static void SetInstigator( Actor b, Actor whomst )
|
||||
{
|
||||
|
|
@ -197,6 +198,7 @@ Class SWWMWhoPushedMe : Inventory
|
|||
if ( ffd )
|
||||
{
|
||||
ffd.instigator = whomst;
|
||||
ffd.killtimer = 0; // cancel kill timer
|
||||
return;
|
||||
}
|
||||
ffd = SWWMWhoPushedMe(Spawn("SWWMWhoPushedMe"));
|
||||
|
|
@ -217,6 +219,28 @@ Class SWWMWhoPushedMe : Inventory
|
|||
return null;
|
||||
}
|
||||
|
||||
override void OwnerDied()
|
||||
{
|
||||
Super.OwnerDied();
|
||||
if ( killtimer > 0 ) return;
|
||||
killtimer = 5;
|
||||
}
|
||||
|
||||
override void DoEffect()
|
||||
{
|
||||
Super.DoEffect();
|
||||
if ( killtimer <= 0 ) return;
|
||||
killtimer--;
|
||||
if ( killtimer > 0 ) return;
|
||||
Destroy();
|
||||
}
|
||||
|
||||
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
|
||||
{
|
||||
if ( !passive || (damageType != 'Falling') || (killtimer > 0) ) return;
|
||||
killtimer = 5;
|
||||
}
|
||||
|
||||
default
|
||||
{
|
||||
+INVENTORY.UNTOSSABLE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue