MedicalAI - Fix treatment animion with no weapon (#4633)

This commit is contained in:
PabstMirror 2016-11-03 18:01:58 -05:00 committed by Glowbal
parent a43b70fe89
commit 0975a4f004

View File

@ -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);