From 5195271894755ac6782c4b60b11862e45530027c Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 19 Apr 2015 11:32:02 +0200 Subject: [PATCH] Fixes: https://github.com/acemod/ACE3/commit/4235163 *The asterix needs to be shown on distances shown in meters not yards --- addons/atragmx/functions/fnc_update_gun.sqf | 15 ++++++++++----- addons/atragmx/functions/fnc_update_target.sqf | 14 ++++++++++---- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index 67e5e651d1..4ca7338e57 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -36,10 +36,15 @@ if (GVAR(currentUnit) != 2) then { } else { ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))]; }; -if (GVAR(currentUnit) == 1) then { - ctrlSetText [140, format["*%1", Round((GVAR(workingMemory) select 2) * 1.0936133)]]; -} else { - ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [140, format["*%1", Round(GVAR(workingMemory) select 2)]]; + }; + case 1: { + ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + }; + case 2: { + ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; + }; }; - [] call FUNC(update_scope_unit); diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index a888e6fdd8..ef2ef1de5c 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -35,8 +35,14 @@ if (GVAR(currentUnit) != 2) then { } else { ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; -if (GVAR(currentUnit) == 1) then { - ctrlSetText [340, format["*%1", Round((GVAR(workingMemory) select 2) * 1.0936133)]]; -} else { - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [340, format["*%1", Round((GVAR(targetRange) select GVAR(currentTarget)))]]; + }; + case 1: { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + }; + case 2: { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; + }; };