From f12ee1735c72aa140fc2719e81dc6e9eef624b17 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Mon, 28 Nov 2022 21:05:29 +0100 Subject: [PATCH] Fix facelight height not updating. --- language.version | 4 ++-- zscript/swwm_player_fx.zsc | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/language.version b/language.version index 7cd4e6e20..1de43a0d1 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r647 \cu(Mon 28 Nov 17:54:45 CET 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r647 \cu(2022-11-28 17:54:45)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r648 \cu(Mon 28 Nov 21:05:29 CET 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r648 \cu(2022-11-28 21:05:29)\c-"; diff --git a/zscript/swwm_player_fx.zsc b/zscript/swwm_player_fx.zsc index 647abd08e..b617bd164 100644 --- a/zscript/swwm_player_fx.zsc +++ b/zscript/swwm_player_fx.zsc @@ -300,6 +300,7 @@ Class DemolitionistSelfLight : Thinker Actor target; transient CVar tagcolor; int oldcolor; + double oldheight; override void Tick() { @@ -334,9 +335,10 @@ Class DemolitionistSelfLight : Thinker // setting the pitch to a value outside [-90,90] makes it auto-update to the actor's own pitch // this is undocumented and it's very great and nice and fine that such a thing had to be found out purely by chance // how very wonderful /s - if ( curactive && (!oldactive || (idx != oldcolor)) ) + double curheight = target.player?(target.player.viewz-target.pos.z):(target.height*.93); + if ( curactive && (!oldactive || (idx != oldcolor) || (curheight != oldheight)) ) { - target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,Color(255,112,144,176),200,0,DynamicLight.LF_DONTLIGHTSELF|DynamicLight.LF_ATTENUATE|DynamicLight.LF_SPOT,(5,0,target.player?(target.player.viewz-target.pos.z):(target.height*.93)),0,15,60,180); + target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,Color(255,112,144,176),200,0,DynamicLight.LF_DONTLIGHTSELF|DynamicLight.LF_ATTENUATE|DynamicLight.LF_SPOT,(5,0,curheight),0,15,60,180); target.A_AttachLight('DemoSelfLight2',DynamicLight.PointLight,litecolor[idx],80,0,DynamicLight.LF_DONTLIGHTSELF|DynamicLight.LF_ATTENUATE,(0,0,target.height/2)); } else if ( !curactive && oldactive ) @@ -346,5 +348,6 @@ Class DemolitionistSelfLight : Thinker } oldactive = curactive; oldcolor = idx; + oldheight = curheight; } }