diff --git a/SQF/dayz_code/actions/player_emptyContainer.sqf b/SQF/dayz_code/actions/player_emptyContainer.sqf index bbfdd89b0..e14493a02 100644 --- a/SQF/dayz_code/actions/player_emptyContainer.sqf +++ b/SQF/dayz_code/actions/player_emptyContainer.sqf @@ -10,6 +10,7 @@ if (dayz_actionInProgress) exitWith {localize "str_epoch_player_56" call dayz_rollingMessages;}; dayz_actionInProgress = true; +closeDialog 0; private "_cfg"; @@ -19,28 +20,32 @@ _cfg = (ConfigFile >> "CfgMagazines" >> _this); if (!isClass(_cfg)) exitWith { diag_log format ["DAYZ ERROR: Invalid magazine classname given to player_emptyContainer: %1", _this]; + dayz_actionInProgress = false; }; //class isn't a consumable if (!isText(_cfg >> "containerEmpty")) exitWith { diag_log format ["DAYZ ERROR: Non-emptiable item classname given to player_emptyContainer: %1", _this]; + dayz_actionInProgress = false; }; //player is on a ladder if ((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1) exitWith { (localize "str_player_21") call dayz_rollingMessages; + dayz_actionInProgress = false; }; //player doesn't have the consumable item -if (!(_this in magazines player)) exitWith { localize "str_misplaced_container" call dayz_rollingMessages; }; +if (!(_this in magazines player)) exitWith { dayz_actionInProgress = false;localize "str_misplaced_container" call dayz_rollingMessages; }; + +//Remove container +player removeMagazine _this; [player,(getPosATL player),5,"refuel"] spawn fnc_alertZombies; player playActionNow "PutDown"; -//Remove container -player removeMagazine _this; player addMagazine getText (_cfg >> "containerEmpty"); //update gear ui or close if the player is in a vehicle