From 6e3a6bb0e3899d212d60eb45a01268a0227b4593 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Mon, 19 Sep 2022 01:02:40 +0200 Subject: [PATCH] Healthbars shouldn't spawn for boss brains unless they're visible. --- language.version | 4 ++-- zscript/swwm_common.zsc | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/language.version b/language.version index 6b12b9be9..3a3173cb4 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r477 \cu(Mon 19 Sep 01:02:21 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r477 \cu(2022-09-19 01:02:21)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r478 \cu(Mon 19 Sep 01:02:40 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r478 \cu(2022-09-19 01:02:40)\c-"; diff --git a/zscript/swwm_common.zsc b/zscript/swwm_common.zsc index fcb550582..f14403871 100644 --- a/zscript/swwm_common.zsc +++ b/zscript/swwm_common.zsc @@ -233,8 +233,12 @@ Class SWWMQuickCombatTracker : Inventory static SWWMQuickCombatTracker Update( SWWMHandler hnd, PlayerInfo p, Actor target, int damage = 0 ) { - if ( target.bNODAMAGE ) return null; // no-damage entities get no healthbars - if ( target is 'LampMoth' ) return null; // also don't give healthbars to moths + // no-damage entities get no healthbars + if ( target.bNODAMAGE ) return null; + // also don't give healthbars to moths + if ( target is 'LampMoth' ) return null; + // don't give them to boss brains unless visible + if ( (target is 'BossBrain') && !p.Camera.CheckSight(target,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) return null; SWWMQuickCombatTracker t = null; for ( Inventory i=target.inv; i; i=i.inv ) {