From 65d9d83ddd47e690f7ad4d0bb2920251bf775310 Mon Sep 17 00:00:00 2001 From: Kaelan Date: Tue, 20 Jul 2021 22:56:41 -0600 Subject: [PATCH] Add 'BF_ONLYVISIBLETHINGS' Flag to A_Blast Adds 'BF_ONLYVISIBLETHINGS' flag to A_Blast, and enables A_Blast to only affect actors that have a line of sight to calling actor. --- wadsrc/static/zscript/actors/hexen/blastradius.zs | 5 +++++ wadsrc/static/zscript/constants.zs | 1 + 2 files changed, 6 insertions(+) diff --git a/wadsrc/static/zscript/actors/hexen/blastradius.zs b/wadsrc/static/zscript/actors/hexen/blastradius.zs index eee084f83..271f2bcfc 100644 --- a/wadsrc/static/zscript/actors/hexen/blastradius.zs +++ b/wadsrc/static/zscript/actors/hexen/blastradius.zs @@ -148,6 +148,11 @@ extend class Actor // in another region and cannot be seen. continue; } + if ((blastflags & BF_ONLYVISIBLETHINGS) && !isVisible(mo, true)) + { + //only blast if target can bee seen by calling actor + continue; + } BlastActor (mo, strength, speed, blasteffect, !!(blastflags & BF_NOIMPACTDAMAGE)); } } diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index 490cfc2cb..63f76d35e 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -285,6 +285,7 @@ enum EBlastFlags BF_DONTWARN = 2, BF_AFFECTBOSSES = 4, BF_NOIMPACTDAMAGE = 8, + BF_ONLYVISIBLETHINGS = 16; }; // Flags for A_SeekerMissile