Please for the love of god let this be the last time I have to shove even more safeguards in the FlakAccumulator class.
This commit is contained in:
parent
416b15683e
commit
692ba81111
1 changed files with 21 additions and 4 deletions
|
|
@ -117,23 +117,40 @@ Class FlakAccumulator : Thinker
|
|||
override void Tick()
|
||||
{
|
||||
Super.Tick();
|
||||
// so many damn safeguards in this
|
||||
if ( !victim )
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
int gibhealth = victim.GetGibHealth();
|
||||
// おまえはもう死んでいる
|
||||
if ( victim.health-total <= gibhealth ) inflictor.bEXTREMEDEATH = true;
|
||||
if ( victim.health-total <= gibhealth )
|
||||
{
|
||||
// safeguard for inflictors that have somehow ceased to exist, which apparently STILL CAN HAPPEN
|
||||
if ( inflictor ) inflictor.bEXTREMEDEATH = true;
|
||||
else type = 'Extreme';
|
||||
}
|
||||
// make sure accumulation isn't reentrant
|
||||
if ( inflictor && (inflictor is 'FlakChunk') ) inflictor.bAMBUSH = true;
|
||||
// 何?
|
||||
inflictor.bAMBUSH = true;
|
||||
for ( int i=0; i<amounts.Size(); i++ )
|
||||
{
|
||||
if ( !victim ) break;
|
||||
victim.DamageMobj(inflictor,source,amounts[i],type,DMG_THRUSTLESS);
|
||||
}
|
||||
inflictor.bAMBUSH = false;
|
||||
inflictor.bEXTREMEDEATH = false;
|
||||
// clean up
|
||||
if ( inflictor )
|
||||
{
|
||||
if ( inflictor is 'FlakChunk' ) inflictor.bAMBUSH = false;
|
||||
inflictor.bEXTREMEDEATH = false;
|
||||
}
|
||||
Destroy();
|
||||
}
|
||||
|
||||
static void Accumulate( Actor victim, int amount, Actor inflictor, Actor source, Name type )
|
||||
{
|
||||
if ( !victim ) return;
|
||||
let ti = ThinkerIterator.Create("FlakAccumulator",STAT_USER);
|
||||
FlakAccumulator a, match = null;
|
||||
while ( a = FlakAccumulator(ti.Next()) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue