From 22e26ee4525a1411a68bb5da0bc5c3f8ad1581fd Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 15 Jan 2024 15:23:12 -0600 Subject: [PATCH] change of switch statements as referenced here https://github.com/acemod/ACE3/pull/9728#discussion_r1452728046 --- addons/frag/functions/fnc_dev_trackHitBox.sqf | 9 ++++----- addons/frag/functions/fnc_doFragTargeted.sqf | 7 +++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/addons/frag/functions/fnc_dev_trackHitBox.sqf b/addons/frag/functions/fnc_dev_trackHitBox.sqf index 63d58f614f..ae1a12e9bf 100644 --- a/addons/frag/functions/fnc_dev_trackHitBox.sqf +++ b/addons/frag/functions/fnc_dev_trackHitBox.sqf @@ -36,11 +36,10 @@ if (_object isKindOf "CAManBase") then { _box params ["_lowP","_upP"]; // adjust with stance -private _stance = stance _object; -switch (true) do { - case (_stance isEqualTo "STAND"): {_upP set [2, 1.9];}; - case (_stance isEqualTo "CROUCH"): {_upP set [2, 1.3];}; - case (_stance isEqualTo "PRONE"): {_upP set [2, 0.8];}; +switch (stance _object) do { + case ("STAND"): {_upP set [2, 1.9];}; + case ("CROUCH"): {_upP set [2, 1.3];}; + case ("PRONE"): {_upP set [2, 0.8];}; }; private _centerPoint = ASLToAGL getPosASL _object; diff --git a/addons/frag/functions/fnc_doFragTargeted.sqf b/addons/frag/functions/fnc_doFragTargeted.sqf index ddbc2c72be..9143a53c74 100644 --- a/addons/frag/functions/fnc_doFragTargeted.sqf +++ b/addons/frag/functions/fnc_doFragTargeted.sqf @@ -81,10 +81,9 @@ private _totalFragCount = 0; private _crossSectionArea = 1; private _isPerson = _target isKindOf "CAManBase"; if (_isPerson) then { - private _stance = stance _target; - switch (true) do { - case (_stance isEqualTo "STAND"): {_height = 1.9; _crossSectionArea = 1.5;}; - case (_stance isEqualTo "CROUCH"): {_height = 1.2; _crossSectionArea = 1;}; + switch (stance _target) do { + case ("STAND"): {_height = 1.9; _crossSectionArea = 1.5;}; + case ("CROUCH"): {_height = 1.2; _crossSectionArea = 1;}; default {_crossSectionArea = 0.75;}; }; } else {