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
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r584 \cu(Sun 23 Oct 12:17:20 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r584 \cu(2022-10-23 12:17:20)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r585 \cu(Sun 23 Oct 23:36:51 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r585 \cu(2022-10-23 23:36:51)\c-";
|
||||
|
|
|
|||
|
|
@ -85,8 +85,9 @@ extend Class SWWMHandler
|
|||
}
|
||||
}
|
||||
if ( !e.DamageSource || !e.DamageSource.player ) return;
|
||||
// fall dmg
|
||||
SWWMWhoPushedMe.SetInstigator(e.Thing,e.DamageSource);
|
||||
// fall dmg tracking
|
||||
if ( !e.Thing.player && (e.Thing.bFALLDAMAGE || level.monsterfallingdamage) )
|
||||
SWWMWhoPushedMe.SetInstigator(e.Thing,e.DamageSource);
|
||||
dealtdamage[e.DamageSource.PlayerNumber()] = true;
|
||||
let s = SWWMStats.Find(e.DamageSource.player);
|
||||
if ( s ) // deathmatch telefrag-on-spawn may cause this to be null
|
||||
|
|
@ -151,7 +152,10 @@ extend Class SWWMHandler
|
|||
// fall damage tracking hack
|
||||
let src = e.DamageSource;
|
||||
if ( (e.DamageType == 'Falling') && !e.DamageSource )
|
||||
src = SWWMWhoPushedMe.RecallInstigator(e.Thing);
|
||||
{
|
||||
let inst = SWWMWhoPushedMe.RecallInstigator(e.Thing);
|
||||
if ( inst ) src = inst;
|
||||
}
|
||||
if ( (!src || !src.player || (src == e.Thing)) ) return;
|
||||
let inflictor = e.Inflictor;
|
||||
if ( inflictor is 'SWWMPuff' ) inflictor = inflictor.master;
|
||||
|
|
|
|||
|
|
@ -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