From c710a6ced7fd3acabca04bc2ab7c5e3bb8fc3bc4 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Wed, 24 Mar 2021 15:37:04 +0100 Subject: [PATCH] I love undocumented features --- language.version | 4 ++-- zscript/swwm_player_fx.zsc | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/language.version b/language.version index 7de51f8ed..4e2b0a0ca 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r398 \cu(Wed 24 Mar 15:32:50 CET 2021)\c-"; -SWWM_SHORTVER="\cw0.9.11b-pre r398 \cu(2021-03-24 15:32:50)\c-"; +SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r399 \cu(Wed 24 Mar 15:37:04 CET 2021)\c-"; +SWWM_SHORTVER="\cw0.9.11b-pre r399 \cu(2021-03-24 15:37:04)\c-"; diff --git a/zscript/swwm_player_fx.zsc b/zscript/swwm_player_fx.zsc index 6d18e92a6..78a89a60b 100644 --- a/zscript/swwm_player_fx.zsc +++ b/zscript/swwm_player_fx.zsc @@ -321,9 +321,11 @@ Class DemolitionistSelfLight : Actor else tagcolor = Color(255,32,48,24); } bool curactive = activelight(); - // have to re-attach it repeatedly to update the pitch (wow great thanks) - if ( curactive ) - target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,Color(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,target.pitch); + // 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 ) + target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,Color(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); else if ( !curactive && oldactive ) target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,0,0,0); oldactive = curactive;