Consolidate DZE_ActionInProgress and r_action_count to one variable

There is no point in having two variables for the same purpose.

It is also pointless to keep an action count tally like r_action_count
was doing, since it is only ever checked for being 0 or 1. Any count
higher or lower than that is irrelevant.

I will make this change in vanilla too.
This commit is contained in:
ebaydayz
2016-08-25 15:38:27 -04:00
parent 6b101d3c2e
commit c2b16f0828
90 changed files with 364 additions and 373 deletions

View File

@@ -1,30 +1,30 @@
private ["_item","_config","_pos","_onLadder","_create","_started","_finished","_animState","_isMedic","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
if (DZE_ActionInProgress) exitWith {localize "str_epoch_player_56" call dayz_rollingMessages;};
DZE_ActionInProgress = true;
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_56" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_item = _this;
_config = configFile >> "cfgWeapons" >> _item;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {DZE_ActionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
if (_onLadder) exitWith {dayz_actionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
_text = getText (_config >> "displayName");
_haskey = _this in weapons player;
if (!_haskey) exitWith {DZE_ActionInProgress = false; format[localize "str_player_30",_text] call dayz_rollingMessages;};
if (!_haskey) exitWith {dayz_actionInProgress = false; format[localize "str_player_30",_text] call dayz_rollingMessages;};
_hastoolweapon = "ItemKeyKit" in weapons player;
if (!_hastoolweapon) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_57" call dayz_rollingMessages;};
if (!_hastoolweapon) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_57" call dayz_rollingMessages;};
_pos = [player] call FNC_GetPos;
_isNear = {inflamed _x} count (_pos nearObjects 3);
if (_isNear == 0) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_58" call dayz_rollingMessages;};
if (_isNear == 0) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_58" call dayz_rollingMessages;};
call gear_ui_init;
// require one tin bar per key
_hasTinBar = "ItemTinBar" in magazines player;
if (!_hasTinBar) exitWith {DZE_ActionInProgress = false; localize "str_epoch_player_59" call dayz_rollingMessages;};
if (!_hasTinBar) exitWith {dayz_actionInProgress = false; localize "str_epoch_player_59" call dayz_rollingMessages;};
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
player playActionNow "Medic";
@@ -72,4 +72,4 @@ if(_finished) then {
};
localize "str_epoch_player_61" call dayz_rollingMessages;
};
DZE_ActionInProgress = false;
dayz_actionInProgress = false;