From 339c14ae52749dc7e5293dc8f970da07f12d6f68 Mon Sep 17 00:00:00 2001 From: A Man Date: Wed, 18 Aug 2021 17:14:57 +0200 Subject: [PATCH] Revert moving down dayz_actionInProgress = true; Do not move dayz_actionInProgress = true; lower. Fast clicker can bypass this check very easy then. Also add isNull check. --- SQF/dayz_code/actions/gather_meat.sqf | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/actions/gather_meat.sqf b/SQF/dayz_code/actions/gather_meat.sqf index 9e90794df..c77bf8ee7 100644 --- a/SQF/dayz_code/actions/gather_meat.sqf +++ b/SQF/dayz_code/actions/gather_meat.sqf @@ -1,11 +1,10 @@ if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;}; +dayz_actionInProgress = true; local _body = _this; - -if (_body getVariable["meatHarvested",false]) exitWith {}; // Exit the script if the meat has already been harvested. -if ({isPlayer _x} count ((getPosATL _body) nearEntities ["CAManBase", 12]) > 1) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;}; // Exit the script if another player is near to prevent duping. - -dayz_actionInProgress = true; +if (isNull _body) exitWith {dayz_actionInProgress = false; systemChat localize "str_cursorTargetNotFound";}; +if (_body getVariable["meatHarvested",false]) exitWith {dayz_actionInProgress = false;}; // Exit the script if the meat has already been harvested. +if ({isPlayer _x} count ((getPosATL _body) nearEntities ["CAManBase", 12]) > 1) exitWith {dayz_actionInProgress = false;localize "str_pickup_limit_5" call dayz_rollingMessages;}; // Exit the script if another player is near to prevent duping. local _type = typeOf _body; local _isZombie = _type isKindOf "zZombie_base"; @@ -74,4 +73,4 @@ closeDialog 0; uiSleep 0.02; _string call dayz_rollingMessages; -dayz_actionInProgress = false; +dayz_actionInProgress = false; \ No newline at end of file