diff --git a/SQF/dayz_code/compile/client_evr.sqf b/SQF/dayz_code/compile/client_evr.sqf index a33025c42..3bb9b19b8 100644 --- a/SQF/dayz_code/compile/client_evr.sqf +++ b/SQF/dayz_code/compile/client_evr.sqf @@ -422,9 +422,7 @@ fnc_evr = { if (player hasWeapon _tool) then { if (random 1 <= DZE_EVRDamageItemsChance) then { player removeWeapon _tool; - if !(player hasWeapon (_x select 1)) then { // prevent duplicates - player addWeapon (_x select 1); - }; + (_x select 1) call player_addDuplicateTool; _items set [count _items, (getText(configFile >> "CfgWeapons" >> _tool >> "displayName"))]; }; }; @@ -441,8 +439,16 @@ fnc_evr = { if (!_hasAPSI) then { if (player == vehicle player) then { uiSleep 10; // 10 second knockout. - player switchMove ""; - [objNull, player, rSwitchMove, ""] call RE; + [nil, player, rSWITCHMOVE, "AmovPpneMstpSnonWnonDnon_healed"] call RE; + player SWITCHMOVE "AmovPpneMstpSnonWnonDnon_healed"; + PVDZ_plr_SwitchMove = [player,"AmovPpneMstpSnonWnonDnon_healed"]; + publicVariableServer "PVDZ_plr_SwitchMove"; //Needed to execute switchMove on server machine. rSwitchMove only executes on other clients + player playMoveNow "AmovPpneMstpSnonWnonDnon_healed"; + + if ({getNumber (configFile >> "CfgWeapons" >> _x >> "type") in [1,2]} count (weapons player) > 0) then { + //Prevent firing while weapon is still shown on back or holstered. AmovPpneMstpSnonWnonDnon_healed has disableWeapons=0 in config (should be 1) + waitUntil {uiSleep 1; !(animationState player in ["ainjppnemstpsnonwnondnon_rolltofront","amovppnemstpsnonwnondnon_healed","amovppnemstpsnonwnondnon"])}; + }; }; } else { cutRsc ["RscAPSI_End","PLAIN"];