diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index 93a784922d..f013486cc1 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -32,7 +32,12 @@ if (stance _unit == "PRONE") then { }; private _anim = getText (_animConfig >> _configProperty); -private _wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _unit, handgunWeapon _unit] find (currentWeapon _unit))); +private _wpn = switch (true) do { + case ((currentWeapon _unit) == ""): {"non"}; + case ((currentWeapon _unit) == (primaryWeapon _unit)): {"rfl"}; + case ((currentWeapon _unit) == (handgunWeapon _unit)): {"pst"}; + default {"non"}; +}; _anim = [_anim, "[wpn]", _wpn] call CBA_fnc_replace; [_unit, _anim] call EFUNC(common,doAnimation);