From 692ba81111c03b0d2dcafe4319706fbbd4967b75 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Thu, 3 Oct 2019 01:25:31 +0200 Subject: [PATCH] Please for the love of god let this be the last time I have to shove even more safeguards in the FlakAccumulator class. --- zscript/flakcannon.zsc | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/zscript/flakcannon.zsc b/zscript/flakcannon.zsc index fb9f0dd..f515c47 100644 --- a/zscript/flakcannon.zsc +++ b/zscript/flakcannon.zsc @@ -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