diff --git a/SQF/dayz_code/Configs/CfgVehicles/CamoNetting.hpp b/SQF/dayz_code/Configs/CfgVehicles/CamoNetting.hpp index 04bfb1b84..4cbe427a1 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/CamoNetting.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/CamoNetting.hpp @@ -27,7 +27,7 @@ position="action"; radius = 3.0; onlyForPlayer = 1; - condition = "alive this"; + condition = "!dayz_actionInProgress && (alive this)"; statement = "this spawn object_dismantle;"; }; }; diff --git a/SQF/dayz_code/Configs/CfgVehicles/Hedgehog.hpp b/SQF/dayz_code/Configs/CfgVehicles/Hedgehog.hpp index e708a93c4..e64135926 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Hedgehog.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Hedgehog.hpp @@ -28,7 +28,7 @@ position="action"; radius = 2.7; onlyForPlayer = 1; - condition = "alive this"; + condition = "!dayz_actionInProgress && (alive this)"; statement = "this spawn object_dismantle;"; }; }; diff --git a/SQF/dayz_code/Configs/CfgVehicles/Sandbag.hpp b/SQF/dayz_code/Configs/CfgVehicles/Sandbag.hpp index 02a64e695..723456591 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Sandbag.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Sandbag.hpp @@ -26,7 +26,7 @@ position="action"; radius = 3.0; onlyForPlayer = 1; - condition = "alive this"; + condition = "!dayz_actionInProgress && (alive this)"; statement = "this spawn object_dismantle;"; }; }; diff --git a/SQF/dayz_code/actions/object_dismantle.sqf b/SQF/dayz_code/actions/object_dismantle.sqf index aad545c3c..9927aab4d 100644 --- a/SQF/dayz_code/actions/object_dismantle.sqf +++ b/SQF/dayz_code/actions/object_dismantle.sqf @@ -1,3 +1,6 @@ +if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; }; +dayz_actionInProgress = true; + private ["_object","_proceed","_rndattemps","_limit","_dismantleToo","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools","_exit","_end","_onLadder","_isWater","_isOk","_counter","_text","_dis","_sfx","_animState","_started","_finished","_isMedic"]; _object = _this; @@ -36,14 +39,14 @@ _tools = getArray (configFile >> "CfgVehicles" >> (typeOf _object) >> "dismantle } foreach _tools; //End missing tools -if (_exit) exitwith {}; +if (_exit) exitwith {dayz_actionInProgress = false;}; //Normal blocked stuff _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming; -if(_isWater or _onLadder) exitWith { localize "str_water_ladder_cant_do" call dayz_rollingMessages; }; +if(_isWater or _onLadder) exitWith {dayz_actionInProgress = false; localize "str_water_ladder_cant_do" call dayz_rollingMessages;}; //Start loop _isOk = true; @@ -151,8 +154,7 @@ if (_proceed) then { format [localize "STR_BLD_DISMANTLED",typeOf _object] call dayz_rollingMessages; - _activatingPlayer = player; - PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer]; + PVDZ_obj_Destroy = [_objectID,_objectUID,player]; publicVariableServer "PVDZ_obj_Destroy"; if (isServer) then { @@ -163,4 +165,6 @@ if (_proceed) then { deleteVehicle _object; [_dismantleToo,1,1] call fn_dropItem; -}; \ No newline at end of file +}; + +dayz_actionInProgress = false; \ No newline at end of file