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

@@ -25,9 +25,8 @@ class ItemActions
*/
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx"];
if (DZE_ActionInProgress || (r_action_count > 0)) exitWith {localize "str_epoch_player_63" call dayz_rollingMessages;};
r_action_count = r_action_count + 1;
DZE_ActionInProgress = true;
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_63" call dayz_rollingMessages;};
dayz_actionInProgress = true;
// This is used to find correct recipe based what itemaction was click allows multiple recipes per item.
_crafting = _this select 0;
@@ -65,8 +64,7 @@ if("workshop" in _needNear) then {
};
if(_abort) exitWith {
format[localize "str_epoch_player_149",_reason,_distance] call dayz_rollingMessages;
DZE_ActionInProgress = false;
r_action_count = 0;
dayz_actionInProgress = false;
};
// diag_log format["Checking for fire: %1", _isFireNear];
@@ -285,5 +283,4 @@ if (_canDo) then {
} else {
localize "str_epoch_player_64" call dayz_rollingMessages;
};
DZE_ActionInProgress = false;
r_action_count = 0;
dayz_actionInProgress = false;