Fix facelight height not updating.
This commit is contained in:
parent
9ce5ee591f
commit
f12ee1735c
2 changed files with 7 additions and 4 deletions
|
|
@ -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-";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue