Slightly speed up a switch model check

Check once instead of twice
This commit is contained in:
ebayShopper
2017-11-10 12:03:05 -05:00
parent ac32a8b2cd
commit 0fadd1e5fc
3 changed files with 3 additions and 4 deletions

View File

@@ -150,7 +150,8 @@ if (!isNil "_newBackpackType" && {_newBackpackType != ""}) then {
if (gear_done) then {sleep 0.001;};
_countr = 0;
{
if (typeName _x != "STRING") then {
_isArray = typeName _x == "ARRAY";
if (_isArray) then {
_isWeapon = isClass (configFile >> "CfgWeapons" >> (_x select 0));
_isMagazine = isClass (configFile >> "CfgMagazines" >> (_x select 0));
} else {
@@ -159,7 +160,7 @@ if (!isNil "_newBackpackType" && {_newBackpackType != ""}) then {
};
if (!_isWeapon || (_isWeapon && _isMagazine)) then {
_countr = _countr + 1;
if (typeName _x != "STRING") then {
if (_isArray) then {
if (_x select 1 > 0) then { //Javelin rockets in BP returns ["Javelin", 0],"Javelin". Dupe on relog -> # real Javs + 1 per skin change
dayz_myBackpack addMagazineCargoGlobal [_x select 0, 1];
_idc = 4999 + _countr;

View File

@@ -536,7 +536,6 @@ if (isNil "DZE_SelfTransfuse") then {DZE_SelfTransfuse = false;};
if (isNil "DZE_selfTransfuse_Values") then {DZE_selfTransfuse_Values = [12000,15,120];};
if (isNil "DZE_PlotPole") then {DZE_PlotPole = [30,45];};
DZE_maintainRange = ((DZE_PlotPole select 0)+20);
if (isNil "DZE_slowZombies") then {DZE_slowZombies = false;};
if (isServer) then {
dayz_serverPUIDArray = [];

View File

@@ -1046,7 +1046,6 @@ class FSM
"_myDest = [ _agent modelToWorld [0,0,0]];" \n
"_agent setVariable [""myDest"",(_agent modelToWorld [0,0,0])];" \n
"" \n
"//_adjustSpeed = if (DZE_slowZombies) then {2} else {_agent getVariable [""speedLimit"", 3]};" \n
"_speedMin = DZE_ZombieSpeed select 0;" \n
"_speedMax = DZE_ZombieSpeed select 1;" \n
"_adjustSpeed = if (_speedMin == _speedMax && ((_speedMin > 0) && (_speedMax > 0))) then {_speedMin} else {_agent getVariable [""speedLimit"", 3]};" \n