mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-21 10:56:29 +03:00
Replace forEach with Count
Use count where you do not need _forEachIndex variable, it's quicker than forEach.
This commit is contained in:
@@ -33,14 +33,14 @@ if(_buy_o_sell == "sell") then {
|
||||
|
||||
_abort = (!(_configName in (weapons player)));
|
||||
|
||||
if(_isToolBelt or _isBinocs) then {
|
||||
if(_isToolBelt || _isBinocs) then {
|
||||
_msg = "Need the item on your toolbelt before you can sell it.";
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
// buying item type must NOT exist if rifle or pistol
|
||||
_msg = "Drop or sell your current weapon before you can buy a new one.";
|
||||
// buying item type must NOT exist if rifle || pistol
|
||||
_msg = "Drop || sell your current weapon before you can buy a new one.";
|
||||
_config = (configFile >> "CfgWeapons" >> _part_out);
|
||||
_configName = configName(_config);
|
||||
_wepType = getNumber(_config >> "Type");
|
||||
@@ -59,12 +59,12 @@ if(_buy_o_sell == "sell") then {
|
||||
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
|
||||
_secondaryWeapon = _x;
|
||||
};
|
||||
} forEach (weapons player);
|
||||
} count (weapons player);
|
||||
_abort = (_secondaryWeapon != "");
|
||||
};
|
||||
if(_isToolBelt or _isBinocs) then {
|
||||
if(_isToolBelt || _isBinocs) then {
|
||||
_abort = (_configName in (weapons player));
|
||||
_msg = "Drop or sell your current toolbelt item before you can buy a new one.";
|
||||
_msg = "Drop || sell your current toolbelt item before you can buy a new one.";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -91,7 +91,7 @@ while {r_doLoop} do {
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
if (_started && !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user