From 99d89f07302e6334fd5dc58f6c4f363eb081ac6d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 9 Jun 2017 15:08:01 +0300 Subject: [PATCH] Fixed position of Targeter's markers during wearing out https://forum.zdoom.org/viewtopic.php?t=56811 --- wadsrc/static/zscript/inventory/powerups.txt | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/wadsrc/static/zscript/inventory/powerups.txt b/wadsrc/static/zscript/inventory/powerups.txt index 055fd518f8..6fb35b067e 100644 --- a/wadsrc/static/zscript/inventory/powerups.txt +++ b/wadsrc/static/zscript/inventory/powerups.txt @@ -1295,6 +1295,9 @@ class PowerTargeter : Powerup InitEffect (); } + const POS_X = 160 - 3; + const POS_Y = 100 - 3; + override void InitEffect () { // Why is this called when the inventory isn't even attached yet @@ -1318,10 +1321,10 @@ class PowerTargeter : Powerup player.SetPsprite(PSprite.TARGETRIGHT, stat + 2); } - player.GetPSprite(PSprite.TARGETCENTER).x = (160-3); - player.GetPSprite(PSprite.TARGETCENTER).y = - player.GetPSprite(PSprite.TARGETLEFT).y = - player.GetPSprite(PSprite.TARGETRIGHT).y = (100-3); + PSprite center = player.GetPSprite(PSprite.TARGETCENTER); + center.x = POS_X; + center.y = POS_Y; + PositionAccuracy (); } @@ -1397,8 +1400,13 @@ class PowerTargeter : Powerup if (player != null) { - player.GetPSprite(PSprite.TARGETLEFT).x = (160-3) - ((100 - player.mo.accuracy)); - player.GetPSprite(PSprite.TARGETRIGHT).x = (160-3)+ ((100 - player.mo.accuracy)); + PSprite left = player.GetPSprite(PSprite.TARGETLEFT); + left.x = POS_X - (100 - player.mo.accuracy); + left.y = POS_Y; + + PSprite right = player.GetPSprite(PSprite.TARGETRIGHT); + right.x = POS_X + (100 - player.mo.accuracy); + right.y = POS_Y; } }