From e54b9983dd7bd7e3c119602403fa75d92dcee57e Mon Sep 17 00:00:00 2001 From: icomrade Date: Tue, 27 May 2014 15:37:57 -0400 Subject: [PATCH] Replace forEach with Count Use count where you do not need _forEachIndex variable, it's quicker than forEach. --- SQF/dayz_code/actions/ammo.sqf | 2 +- SQF/dayz_code/actions/boil.sqf | 4 +- SQF/dayz_code/actions/cargocheck.sqf | 12 +- SQF/dayz_code/actions/cook.sqf | 4 +- SQF/dayz_code/actions/dayz_spaceInterrupt.sqf | 46 +++--- SQF/dayz_code/actions/dog/feed.sqf | 2 +- SQF/dayz_code/actions/dog/stay.sqf | 2 +- SQF/dayz_code/actions/dog/warn.sqf | 2 +- SQF/dayz_code/actions/fill_nearestVehicle.sqf | 8 +- SQF/dayz_code/actions/fill_startGenerator.sqf | 6 +- SQF/dayz_code/actions/flare_pickup.sqf | 2 +- SQF/dayz_code/actions/gather_meat.sqf | 6 +- SQF/dayz_code/actions/gather_zparts.sqf | 6 +- SQF/dayz_code/actions/hotwire_veh.sqf | 2 +- SQF/dayz_code/actions/jerry_fill.sqf | 10 +- SQF/dayz_code/actions/lock_veh.sqf | 2 +- SQF/dayz_code/actions/maintain_area.sqf | 16 +- SQF/dayz_code/actions/player_build.sqf | 26 +-- .../actions/player_buildingDowngrade.sqf | 8 +- .../actions/player_buildingMaint.sqf | 8 +- SQF/dayz_code/actions/player_copyKey.sqf | 2 +- .../actions/player_countmagazines.sqf | 2 +- SQF/dayz_code/actions/player_craftItem.sqf | 26 +-- SQF/dayz_code/actions/player_drink.sqf | 8 +- SQF/dayz_code/actions/player_eat.sqf | 4 +- SQF/dayz_code/actions/player_findLights.sqf | 2 +- SQF/dayz_code/actions/player_goFishing.sqf | 2 +- SQF/dayz_code/actions/player_harvestPlant.sqf | 4 +- SQF/dayz_code/actions/player_heliLift.sqf | 8 +- SQF/dayz_code/actions/player_reloadMags.sqf | 6 +- SQF/dayz_code/actions/player_upgrade.sqf | 12 +- SQF/dayz_code/actions/pzombie/pz_attack.sqf | 2 +- SQF/dayz_code/actions/pzombie/pz_feed.sqf | 2 +- .../actions/pzombie/pz_vision_rbg1.sqf | 2 +- SQF/dayz_code/actions/refuel.sqf | 6 +- SQF/dayz_code/actions/remove.sqf | 10 +- SQF/dayz_code/actions/repair.sqf | 10 +- SQF/dayz_code/actions/repair_cancel.sqf | 2 +- SQF/dayz_code/actions/repair_vehicle.sqf | 4 +- SQF/dayz_code/actions/salvage.sqf | 6 +- SQF/dayz_code/actions/salvage_vehicle.sqf | 10 +- SQF/dayz_code/actions/show_dialog.sqf | 2 +- SQF/dayz_code/actions/siphonFuel.sqf | 6 +- SQF/dayz_code/actions/stopGenerator.sqf | 4 +- SQF/dayz_code/actions/tame_dog.sqf | 2 +- SQF/dayz_code/actions/tent_pitch.sqf | 2 +- SQF/dayz_code/actions/tow_AttachStraps.sqf | 8 +- SQF/dayz_code/actions/tow_DetachStraps.sqf | 2 +- SQF/dayz_code/actions/trade_any_bicycle.sqf | 8 +- .../actions/trade_any_bicycle_old.sqf | 10 +- SQF/dayz_code/actions/trade_any_boat.sqf | 6 +- SQF/dayz_code/actions/trade_any_boat_old.sqf | 8 +- SQF/dayz_code/actions/trade_any_vehicle.sqf | 12 +- .../actions/trade_any_vehicle_free.sqf | 8 +- .../actions/trade_any_vehicle_old.sqf | 12 +- SQF/dayz_code/actions/trade_backpacks.sqf | 2 +- SQF/dayz_code/actions/trade_backpacks_old.sqf | 4 +- SQF/dayz_code/actions/trade_cancel.sqf | 2 +- SQF/dayz_code/actions/trade_items.sqf | 2 +- SQF/dayz_code/actions/trade_items_old.sqf | 2 +- SQF/dayz_code/actions/trade_items_wo_db.sqf | 2 +- SQF/dayz_code/actions/trade_metals.sqf | 4 +- SQF/dayz_code/actions/trade_weapons.sqf | 14 +- SQF/dayz_code/actions/trade_weapons_old.sqf | 4 +- SQF/dayz_code/actions/unlock_veh.sqf | 2 +- SQF/dayz_code/actions/vault_combination_1.sqf | 2 +- SQF/dayz_code/actions/vault_pitch.sqf | 2 +- SQF/dayz_code/actions/veh_seatActions.sqf | 6 +- SQF/dayz_code/actions/water_fill.sqf | 4 +- SQF/dayz_code/anim/saw_idle.rtm | Bin 12900 -> 12897 bytes .../compile/BIS_fnc/fn_findNestedElement.sqf | 4 +- SQF/dayz_code/compile/BIS_fnc/fn_param.sqf | 6 +- .../compile/BIS_fnc/fn_vectorAdd.sqf | 2 +- SQF/dayz_code/compile/building_spawnLoot.sqf | 6 +- .../compile/building_spawnZombies.sqf | 2 +- SQF/dayz_code/compile/dog_findTargetAgent.sqf | 2 +- SQF/dayz_code/compile/epoch_returnChange.sqf | 2 +- .../compile/fn_buildWeightedArray.sqf | 8 +- SQF/dayz_code/compile/fn_checkItems.sqf | 8 +- SQF/dayz_code/compile/fn_damageActions.sqf | 44 ++--- SQF/dayz_code/compile/fn_damageHandler.sqf | 22 +-- SQF/dayz_code/compile/fn_damageHandlerZ.sqf | 2 +- SQF/dayz_code/compile/fn_gearMenuChecks.sqf | 4 +- SQF/dayz_code/compile/fn_hasTools.sqf | 6 +- SQF/dayz_code/compile/fn_inAngleSector.sqf | 2 +- SQF/dayz_code/compile/fn_isInsideBuilding.sqf | 6 +- .../compile/fn_isInsideBuilding2.sqf | 6 +- .../compile/fn_isInsideBuilding3.sqf | 6 +- SQF/dayz_code/compile/fn_lightFunctions.sqf | 4 +- SQF/dayz_code/compile/fn_removeItems.sqf | 10 +- .../compile/fn_selectRandomWeighted.sqf | 10 +- SQF/dayz_code/compile/fn_selfActions.sqf | 156 +++++++++--------- SQF/dayz_code/compile/fn_setpitchbank.sqf | 12 +- SQF/dayz_code/compile/fn_temperatur.sqf | 6 +- SQF/dayz_code/compile/fn_unconscious.sqf | 14 +- SQF/dayz_code/compile/local_gutObject.sqf | 6 +- SQF/dayz_code/compile/local_gutObjectZ.sqf | 6 +- SQF/dayz_code/compile/local_lights_house.sqf | 10 +- SQF/dayz_code/compile/local_lights_init.sqf | 16 +- SQF/dayz_code/compile/local_lights_off.sqf | 10 +- SQF/dayz_code/compile/local_lights_tower.sqf | 2 +- SQF/dayz_code/compile/local_roadDebris.sqf | 2 +- SQF/dayz_code/compile/object_cargoCheck.sqf | 4 +- SQF/dayz_code/compile/object_monitorGear.sqf | 10 +- SQF/dayz_code/compile/object_processHit.sqf | 6 +- SQF/dayz_code/compile/object_removeNearby.sqf | 4 +- SQF/dayz_code/compile/object_setFixServer.sqf | 2 +- SQF/dayz_code/compile/object_setHitServer.sqf | 2 +- SQF/dayz_code/compile/object_speak.sqf | 4 +- SQF/dayz_code/compile/player_alertZombies.sqf | 2 +- SQF/dayz_code/compile/player_animalCheck.sqf | 2 +- SQF/dayz_code/compile/player_antiWall.sqf | 6 +- SQF/dayz_code/compile/player_checkStealth.sqf | 4 +- SQF/dayz_code/compile/player_death.sqf | 6 +- SQF/dayz_code/compile/player_dumpBackpack.sqf | 2 +- SQF/dayz_code/compile/player_fired.sqf | 10 +- SQF/dayz_code/compile/player_gearSet.sqf | 4 +- SQF/dayz_code/compile/player_gearSync.sqf | 2 +- SQF/dayz_code/compile/player_harvest.sqf | 4 +- .../compile/player_humanityMorph.sqf | 2 +- SQF/dayz_code/compile/player_lockVault.sqf | 2 +- SQF/dayz_code/compile/player_murderMenu.sqf | 4 +- SQF/dayz_code/compile/player_music.sqf | 2 +- SQF/dayz_code/compile/player_onPause.sqf | 8 +- SQF/dayz_code/compile/player_packTent.sqf | 8 +- SQF/dayz_code/compile/player_packVault.sqf | 12 +- .../compile/player_projectileNear.sqf | 8 +- SQF/dayz_code/compile/player_spawnCheck.sqf | 18 +- SQF/dayz_code/compile/player_switchModel.sqf | 22 +-- .../compile/player_traderMenuConfig.sqf | 2 +- .../compile/player_traderMenuHive.sqf | 4 +- SQF/dayz_code/compile/player_unlockVault.sqf | 18 +- SQF/dayz_code/compile/player_updateGui.sqf | 14 +- .../compile/player_upgradeVehicle.sqf | 24 +-- SQF/dayz_code/compile/player_weaponCheck.sqf | 4 +- .../compile/player_weaponFiredNear.sqf | 14 +- SQF/dayz_code/compile/player_zombieAttack.sqf | 6 +- SQF/dayz_code/compile/player_zombieCheck.sqf | 10 +- SQF/dayz_code/compile/spawn_loot.sqf | 20 +-- SQF/dayz_code/compile/spawn_loot_small.sqf | 12 +- SQF/dayz_code/compile/ui_changeDisplay.sqf | 2 +- SQF/dayz_code/compile/ui_gear_sound.sqf | 2 +- SQF/dayz_code/compile/ui_selectSlot.sqf | 2 +- .../compile/vehicle_handleKilled.sqf | 2 +- SQF/dayz_code/compile/wild_spawnZombies.sqf | 4 +- SQF/dayz_code/compile/zombie_findTarget.sqf | 18 +- .../compile/zombie_findTargetAgent.sqf | 4 +- SQF/dayz_code/compile/zombie_generate.sqf | 10 +- SQF/dayz_code/external/DRN_ReadMe.txt | 70 ++++---- .../external/DynamicWeatherEffects.sqf | 52 +++--- .../R3F_Realism/R3F_Tired/R3F_DoTired.sqf | 2 +- .../R3F_Weight/R3F_WEIGHT_Configuration.sqf | 2 +- .../R3F_Weight/R3F_Weight_Fnct.sqf | 4 +- SQF/dayz_code/init/compiles.sqf | 40 ++--- SQF/dayz_code/init/object_pickupAction.sqf | 6 +- SQF/dayz_code/init/publicEH.sqf | 2 +- SQF/dayz_code/init/variables.sqf | 6 +- SQF/dayz_code/medical/bandage.sqf | 6 +- SQF/dayz_code/medical/init_medical.sqf | 12 +- SQF/dayz_code/medical/morphine.sqf | 4 +- SQF/dayz_code/medical/painkiller.sqf | 2 +- SQF/dayz_code/medical/publicEH/animHealed.sqf | 2 +- .../medical/publicEH/medBandaged.sqf | 2 +- .../medical/publicEH/medMorphine.sqf | 2 +- .../medical/publicEH/medPainkiller.sqf | 2 +- SQF/dayz_code/medical/self_transfusion.sqf | 2 +- SQF/dayz_code/medical/setup_functions_med.sqf | 26 +-- SQF/dayz_code/medical/transfusion.sqf | 2 +- SQF/dayz_code/music.fsm | 2 +- .../system/BIS_Effects/airdestruction.sqf | 4 +- .../system/BIS_Effects/secondaries.sqf | 4 +- SQF/dayz_code/system/REsec.sqf | 12 +- SQF/dayz_code/system/animal_agent.fsm | 4 +- SQF/dayz_code/system/antihack.sqf | 12 +- SQF/dayz_code/system/building_monitor.sqf | 4 +- SQF/dayz_code/system/ca/functions/init.sqf | 6 +- SQF/dayz_code/system/dog_agent.fsm | 24 +-- SQF/dayz_code/system/fire_monitor.sqf | 4 +- SQF/dayz_code/system/handleGear.sqf | 2 +- SQF/dayz_code/system/player_monitor.fsm | 44 ++--- SQF/dayz_code/system/player_spawn_1.sqf | 2 +- SQF/dayz_code/system/player_spawn_2.sqf | 26 +-- SQF/dayz_code/system/zombie_agent.fsm | 2 +- .../compile/server_maintainArea.sqf | 6 +- .../compile/server_onPlayerDisconnect.sqf | 6 +- SQF/dayz_server/compile/server_playerDied.sqf | 4 +- .../compile/server_playerLogin.sqf | 4 +- .../compile/server_playerSetup.sqf | 12 +- SQF/dayz_server/compile/server_playerSync.sqf | 22 +-- .../compile/server_publishVehicle.sqf | 8 +- .../compile/server_publishVehicle2.sqf | 2 +- .../compile/server_publishVehicle3.sqf | 8 +- .../compile/server_spawnCrashSite.sqf | 4 +- SQF/dayz_server/compile/server_spawnEvent.sqf | 4 +- SQF/dayz_server/compile/server_swapObject.sqf | 2 +- .../compile/server_updateObject.sqf | 14 +- SQF/dayz_server/compile/server_weather.sqf | 4 +- SQF/dayz_server/init/server_functions.sqf | 50 +++--- .../missions/DayZ_Epoch_13.Tavi/bandit.sqf | 2 +- .../missions/DayZ_Epoch_13.Tavi/bilgrad.sqf | 2 +- .../missions/DayZ_Epoch_13.Tavi/branibor.sqf | 2 +- .../missions/DayZ_Epoch_13.Tavi/hero.sqf | 2 +- .../missions/DayZ_Epoch_13.Tavi/lyepestok.sqf | 2 +- .../DayZ_Epoch_13.Tavi/miscvendors.sqf | 2 +- .../missions/DayZ_Epoch_13.Tavi/sabina.sqf | 2 +- .../DayZ_Epoch_13.Tavi/wholesalers.sqf | 2 +- SQF/dayz_server/modules/crash_spawner.sqf | 4 +- SQF/dayz_server/modules/supply_drop.sqf | 4 +- SQF/dayz_server/system/server_cleanup.fsm | 4 +- SQF/dayz_server/system/server_monitor.sqf | 24 +-- 210 files changed, 890 insertions(+), 890 deletions(-) diff --git a/SQF/dayz_code/actions/ammo.sqf b/SQF/dayz_code/actions/ammo.sqf index 478ef4f5e..f1d4df634 100644 --- a/SQF/dayz_code/actions/ammo.sqf +++ b/SQF/dayz_code/actions/ammo.sqf @@ -13,7 +13,7 @@ _magazines = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines"); if (_ammoType == "") then {_ammoType = _x;}; if (!(_ammoType in _text)) then {_text set [count _text,_ammoType];}; if (_x in magazines player) exitWith {_ammo = _x;}; -} forEach _magazines; +} count _magazines; if (_ammo != "") then { _vehicle removeMagazineTurret [_ammo,_turret]; _vehicle addMagazineTurret [_ammo,_turret]; diff --git a/SQF/dayz_code/actions/boil.sqf b/SQF/dayz_code/actions/boil.sqf index 1c9a5c19f..a4d14872d 100644 --- a/SQF/dayz_code/actions/boil.sqf +++ b/SQF/dayz_code/actions/boil.sqf @@ -13,7 +13,7 @@ _hastinitem = false; _hastinitem = true; }; -} forEach boil_tin_cans; +} count boil_tin_cans; _bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName"); _tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName"); @@ -24,7 +24,7 @@ if (!_hastinitem) exitWith {DZE_ActionInProgress = false; cutText [format[(local _removed = 0; -if (_hasbottleitem and _hastinitem) then { +if (_hasbottleitem && _hastinitem) then { _qty = {_x == "ItemWaterbottle"} count magazines player; if ("ItemWaterbottle" in magazines player) then { diff --git a/SQF/dayz_code/actions/cargocheck.sqf b/SQF/dayz_code/actions/cargocheck.sqf index f9d47ff54..8019f7140 100644 --- a/SQF/dayz_code/actions/cargocheck.sqf +++ b/SQF/dayz_code/actions/cargocheck.sqf @@ -12,22 +12,22 @@ _maxWeapons = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxW // Get max backpack count _maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks"); -// Count and show magazines available space +// Count && show magazines available space _magazineCount_raw = getMagazineCargo _vehicle; -// Count and show weapons available space +// Count && show weapons available space _weaponsCount_raw = getWeaponCargo _vehicle; -// Count and show backpacks available space +// Count && show backpacks available space _backpackCount_raw = getBackpackCargo _vehicle; -// Count and show magazines available space +// Count && show magazines available space _magazineCount = (_magazineCount_raw select 1) call vehicle_gear_count; -// Count and show weapons available space +// Count && show weapons available space _weaponsCount = (_weaponsCount_raw select 1) call vehicle_gear_count; -// Count and show weapons available space +// Count && show weapons available space _backpackCount = (_backpackCount_raw select 1) call vehicle_gear_count; cutText [format[(localize "str_epoch_player_1"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"]; diff --git a/SQF/dayz_code/actions/cook.sqf b/SQF/dayz_code/actions/cook.sqf index 9f833423c..8f128424f 100644 --- a/SQF/dayz_code/actions/cook.sqf +++ b/SQF/dayz_code/actions/cook.sqf @@ -43,7 +43,7 @@ _cookedmeat = meatcooked; if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -74,7 +74,7 @@ _cookedmeat = meatcooked; cutText [format[(localize "str_epoch_player_130"),_textraw], "PLAIN DOWN"]; }; }; -} forEach _rawmeat; +} count _rawmeat; s_player_cook = -1; DZE_ActionInProgress = false; \ No newline at end of file diff --git a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf index b5fabfbf7..0df2ca363 100644 --- a/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf +++ b/SQF/dayz_code/actions/dayz_spaceInterrupt.sqf @@ -7,7 +7,7 @@ if (_dikCode in[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D _handled = true; }; -if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3)) then { +if ((_dikCode == 0x3E || _dikCode == 0x0F || _dikCode == 0xD3)) then { if(diag_tickTime - dayz_lastCheckBit > 10) then { dayz_lastCheckBit = diag_tickTime; call dayz_forceSave; @@ -31,9 +31,9 @@ if (_dikCode in actionKeys "Surrender") then { _vehicle = vehicle player; _inVehicle = (_vehicle != player); _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; - _canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder and !_inVehicle); + _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder && !_inVehicle); - if (_canDo and !DZE_Surrender and !(player isKindOf "PZombie_VB")) then { + if (_canDo && !DZE_Surrender && !(player isKindOf "PZombie_VB")) then { DZE_Surrender = true; _dropPrimary = false; _dropSecondary = false; @@ -45,10 +45,10 @@ if (_dikCode in actionKeys "Surrender") then { if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith { _secondaryWeapon = _x; }; - } forEach (weapons player); + } count (weapons player); if (_secondaryWeapon != "") then {_dropSecondary = true;}; - if (_dropPrimary or _dropSecondary) then { + if (_dropPrimary || _dropSecondary) then { player playActionNow "PutDown"; _iPos = getPosATL player; _radius = 1; @@ -85,15 +85,15 @@ if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true; if (DZE_Su if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};}; //Prevent exploit of drag body -if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; }; -if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; }; +if ((_dikCode in actionKeys "Prone") && r_drag_sqf) exitWith { force_dropBody = true; }; +if ((_dikCode in actionKeys "Crouch") && r_drag_sqf) exitWith { force_dropBody = true; }; _shift = _this select 2; _ctrl = _this select 3; _alt = _this select 4; //diag_log format["Keypress: %1", _this]; -if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shift and !_ctrl and !_alt && !dialog) then { +if ((_dikCode in actionKeys "Gear") && (vehicle player != player) && !_shift && !_ctrl && !_alt && !dialog) then { createGearDialog [player, "RscDisplayGear"]; _handled = true; }; @@ -117,59 +117,59 @@ if (_dikCode in (actionKeys "GetOver")) then { }; }; //if (_dikCode == 57) then {_handled = true}; // space -//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true}; +//if (_dikCode in actionKeys 'MoveForward' || _dikCode in actionKeys 'MoveBack') then {r_interrupt = true}; if (_dikCode == 210) then { _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf"; }; if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true}; -if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then { +if (_dikCode in actionKeys "PushToTalk" && (diag_tickTime - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = diag_tickTime; [player,50,true,(getPosATL player)] spawn player_alertZombies; }; -if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then { +if (_dikCode in actionKeys "VoiceOverNet" && (diag_tickTime - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = diag_tickTime; [player,50,true,(getPosATL player)] spawn player_alertZombies; }; -if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then { +if (_dikCode in actionKeys "PushToTalkDirect" && (diag_tickTime - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = diag_tickTime; [player,15,false,(getPosATL player)] spawn player_alertZombies; }; -if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then { +if (_dikCode in actionKeys "Chat" && (diag_tickTime - dayz_lastCheckBit > 10)) then { dayz_lastCheckBit = diag_tickTime; [player,15,false,(getPosATL player)] spawn player_alertZombies; }; -if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then { +if (_dikCode in actionKeys "User20" && (diag_tickTime - dayz_lastCheckBit > 5)) then { dayz_lastCheckBit = diag_tickTime; _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf"; }; // numpad 8 0x48 now pgup 0xC9 1 -if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then { +if ((_dikCode == 0xC9 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User15")) then { DZE_Q = true; }; // numpad 2 0x50 now pgdn 0xD1 -if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then { +if ((_dikCode == 0xD1 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User16")) then { DZE_Z = true; }; // numpad 8 0x48 now pgup 0xC9 0.1 -if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then { +if ((_dikCode == 0xC9 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User13")) then { DZE_Q_alt = true; }; // numpad 2 0x50 now pgdn 0xD1 -if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then { +if ((_dikCode == 0xD1 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User14")) then { DZE_Z_alt = true; }; // numpad 8 0x48 now pgup 0xC9 0.01 -if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then { +if ((_dikCode == 0xC9 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User7")) then { DZE_Q_ctrl = true; }; // numpad 2 0x50 now pgdn 0xD1 -if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then { +if ((_dikCode == 0xD1 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User8")) then { DZE_Z_ctrl = true; }; @@ -177,15 +177,15 @@ if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8") // numpad 4 0x4B now Q 0x10 -if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then { +if (_dikCode == 0x10 || (_dikCode in actionKeys "User17")) then { DZE_4 = true; }; // numpad 6 0x4D now E 0x12 -if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then { +if (_dikCode == 0x12 || (_dikCode in actionKeys "User18")) then { DZE_6 = true; }; // numpad 5 0x4C now space 0x39 -if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then { +if (_dikCode == 0x39 || (_dikCode in actionKeys "User19")) then { DZE_5 = true; }; diff --git a/SQF/dayz_code/actions/dog/feed.sqf b/SQF/dayz_code/actions/dog/feed.sqf index 0a60dcac1..bee74eed8 100644 --- a/SQF/dayz_code/actions/dog/feed.sqf +++ b/SQF/dayz_code/actions/dog/feed.sqf @@ -18,7 +18,7 @@ switch (_type) do { if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then { _removed = _removed + ([player,_x] call BIS_fnc_invRemove); }; - } forEach magazines player; + } count magazines player; if(_removed == _countIn) then { _handle setFSMVariable ["_hunger",0]; player removeAction s_player_feeddog; diff --git a/SQF/dayz_code/actions/dog/stay.sqf b/SQF/dayz_code/actions/dog/stay.sqf index 9b6efc483..0c717dc69 100644 --- a/SQF/dayz_code/actions/dog/stay.sqf +++ b/SQF/dayz_code/actions/dog/stay.sqf @@ -6,7 +6,7 @@ _handle setFSMVariable ["_command","stay"]; _watchDog = _handle getFSMVariable "_watchDog"; _anim = animationState _dog; -if (_anim == "Dog_SitDown" and _watchDog) then { +if (_anim == "Dog_SitDown" && _watchDog) then { //[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE; //sleep 0.5; [objNull, _dog, rSwitchMove,"Dog_LieDown"] call RE; diff --git a/SQF/dayz_code/actions/dog/warn.sqf b/SQF/dayz_code/actions/dog/warn.sqf index ca08ecbdf..f8e9eaca7 100644 --- a/SQF/dayz_code/actions/dog/warn.sqf +++ b/SQF/dayz_code/actions/dog/warn.sqf @@ -12,7 +12,7 @@ _handle setFSMVariable ["_watchDog",_watchDog]; _warn = { private ["_watchDog","_dog","_nearby","_senseSkill","_handle"]; _handle = _this select 0; - while {_watchDog and alive _dog} do { + while {_watchDog && alive _dog} do { _watchDog = _handle getFSMVariable "_watchDog"; _senseSkill = _handle getFSMVariable "_senseSkill"; if (_watchDog) then { diff --git a/SQF/dayz_code/actions/fill_nearestVehicle.sqf b/SQF/dayz_code/actions/fill_nearestVehicle.sqf index 06b99964a..1fa14766f 100644 --- a/SQF/dayz_code/actions/fill_nearestVehicle.sqf +++ b/SQF/dayz_code/actions/fill_nearestVehicle.sqf @@ -9,7 +9,7 @@ _vehicleSrc = _this select 3; if(!(isNull _vehicleSrc)) then { - _isVehicle = ((_vehicleSrc isKindOf "AllVehicles") and !(_vehicleSrc isKindOf "Man")); + _isVehicle = ((_vehicleSrc isKindOf "AllVehicles") && !(_vehicleSrc isKindOf "Man")); // If fuel source is vehicle get actual capacity _configSrcVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicleSrc); _capacitySrc = getNumber(_configSrcVeh >> "fuelCapacity"); @@ -21,10 +21,10 @@ _findNearestVehicles = nearestObjects [player, ["AllVehicles"], 30]; _findNearestVehicle = []; { //diag_log ("FILL = " + str(_x) + " = " + str(_vehicleSrc)); - if (alive _x and !(_x == _vehicleSrc) and !(_x isKindOf "Man")) exitWith { + if (alive _x && !(_x == _vehicleSrc) && !(_x isKindOf "Man")) exitWith { _findNearestVehicle set [(count _findNearestVehicle),_x]; }; -} foreach _findNearestVehicles; +} count _findNearestVehicles; _IsNearVehicle = count (_findNearestVehicle); @@ -67,7 +67,7 @@ if(_IsNearVehicle >= 1) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/fill_startGenerator.sqf b/SQF/dayz_code/actions/fill_startGenerator.sqf index d0ae5d701..48529e77e 100644 --- a/SQF/dayz_code/actions/fill_startGenerator.sqf +++ b/SQF/dayz_code/actions/fill_startGenerator.sqf @@ -29,7 +29,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -50,9 +50,9 @@ if(!_finished) then { }; if (_finished) then { - // take jerry can and replace with empty + // take jerry can && replace with empty - if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then { + if(!(_vehicle getVariable ["GeneratorFilled", false]) && ("ItemJerrycan" in magazines player)) then { if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then { player addMagazine "ItemJerrycanEmpty"; diff --git a/SQF/dayz_code/actions/flare_pickup.sqf b/SQF/dayz_code/actions/flare_pickup.sqf index aff037ae8..a1d947392 100644 --- a/SQF/dayz_code/actions/flare_pickup.sqf +++ b/SQF/dayz_code/actions/flare_pickup.sqf @@ -14,7 +14,7 @@ dayz_hasLight = true; _text = getText (configFile >> "CfgAmmo" >> (typeOf _flare) >> "displayName"); s_player_dropflare = player addAction [format[localize "str_actions_medical_16",_text], "\z\addons\dayz_code\actions\flare_drop.sqf",_flare, 1, false, true, "", ""]; -while {(alive _flare) and dayz_hasLight} do { +while {(alive _flare) && dayz_hasLight} do { sleep 0.1; }; if (dayz_hasLight) then { diff --git a/SQF/dayz_code/actions/gather_meat.sqf b/SQF/dayz_code/actions/gather_meat.sqf index 16feb91e2..fefb63b09 100644 --- a/SQF/dayz_code/actions/gather_meat.sqf +++ b/SQF/dayz_code/actions/gather_meat.sqf @@ -13,7 +13,7 @@ _type = typeOf _item; _hasHarvested = _item getVariable["meatHarvested",false]; _config = configFile >> "CfgSurvival" >> "Meat" >> _type; -if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { +if ((_hasKnife || _hasKnifeBlunt) && !_hasHarvested) then { //Get Animal Type _isListed = isClass (_config); _text = getText (configFile >> "CfgVehicles" >> _type >> "displayName"); @@ -37,7 +37,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -60,7 +60,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { _hasHarvested = _item getVariable["meatHarvested",false]; - if(_finished and !_hasHarvested) then { + if(_finished && !_hasHarvested) then { _item setVariable["meatHarvested",true,true]; diff --git a/SQF/dayz_code/actions/gather_zparts.sqf b/SQF/dayz_code/actions/gather_zparts.sqf index 92687b6e0..e9f37086e 100644 --- a/SQF/dayz_code/actions/gather_zparts.sqf +++ b/SQF/dayz_code/actions/gather_zparts.sqf @@ -13,7 +13,7 @@ _type = typeOf _item; _hasHarvested = _item getVariable["meatHarvested",false]; //_config = configFile >> "CfgSurvival" >> "Meat" >> _type; -if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { +if ((_hasKnife || _hasKnifeBlunt) && !_hasHarvested) then { //Get Animal Type //_loop = true; //_isListed = isClass (_config); @@ -38,7 +38,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -61,7 +61,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then { _hasHarvested = _item getVariable["meatHarvested",false]; - if(_finished and !_hasHarvested) then { + if(_finished && !_hasHarvested) then { _item setVariable["meatHarvested",true,true]; diff --git a/SQF/dayz_code/actions/hotwire_veh.sqf b/SQF/dayz_code/actions/hotwire_veh.sqf index 1190a9ee1..3f555697e 100644 --- a/SQF/dayz_code/actions/hotwire_veh.sqf +++ b/SQF/dayz_code/actions/hotwire_veh.sqf @@ -4,7 +4,7 @@ _vehicle = _this select 3; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_32") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; +{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = []; s_player_lockUnlock_crtl = 1; _removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove); diff --git a/SQF/dayz_code/actions/jerry_fill.sqf b/SQF/dayz_code/actions/jerry_fill.sqf index e03dd3571..c3b82fdee 100644 --- a/SQF/dayz_code/actions/jerry_fill.sqf +++ b/SQF/dayz_code/actions/jerry_fill.sqf @@ -12,10 +12,10 @@ _abort = false; _fuelCans = []; { - if(_x == "ItemJerrycanEmpty" or _x == "ItemFuelBarrelEmpty") then { + if(_x == "ItemJerrycanEmpty" || _x == "ItemFuelBarrelEmpty") then { _fuelCans set [(count _fuelCans),_x]; }; -} forEach magazines player; +} count magazines player; _qty = count _fuelCans; @@ -29,7 +29,7 @@ _qty = count _fuelCans; [1,1] call dayz_HungerThirst; // force animation player playActionNow "Medic"; - // Play sound and alert zombies + // Play sound && alert zombies _dis=10; _sfx = "refuel"; @@ -48,7 +48,7 @@ _qty = count _fuelCans; if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -85,7 +85,7 @@ _qty = count _fuelCans; sleep 1; if(_abort) exitWith {}; -} forEach _fuelCans; +} count _fuelCans; s_player_fillfuel = -1; DZE_ActionInProgress = false; \ No newline at end of file diff --git a/SQF/dayz_code/actions/lock_veh.sqf b/SQF/dayz_code/actions/lock_veh.sqf index 75ca4b5e4..895af6398 100644 --- a/SQF/dayz_code/actions/lock_veh.sqf +++ b/SQF/dayz_code/actions/lock_veh.sqf @@ -4,7 +4,7 @@ _vehicle = _this select 3; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_37") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; +{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = []; s_player_lockUnlock_crtl = 1; PVDZE_veh_Lock = [_vehicle,true]; diff --git a/SQF/dayz_code/actions/maintain_area.sqf b/SQF/dayz_code/actions/maintain_area.sqf index aeebdee51..4ab4d0976 100644 --- a/SQF/dayz_code/actions/maintain_area.sqf +++ b/SQF/dayz_code/actions/maintain_area.sqf @@ -1,4 +1,4 @@ -//Code developed by Axe Cop - Massiv improvments and performance tunes by Skaronator +//Code developed by Axe Cop - Massiv improvments && performance tunes by Skaronator private ["_missing","_missingQty","_proceed","_itemIn","_countIn","_qty","_num_removed","_uniqueID","_removed","_removed_total","_tobe_removed_total","_obj","_objectID","_objectUID","_classname","_location","_dir","_objectCharacterID","_object","_temp_removed_array","_textMissing","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_itemText","_option"]; if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; }; @@ -21,7 +21,7 @@ _objects_filtered = []; if (damage _x >= DZE_DamageBeforeMaint) then { _objects_filtered set [count _objects_filtered, _x]; }; -} forEach _objects; +} count _objects; _objects = _objects_filtered; // TODO dynamic requirements based on used building parts? @@ -66,7 +66,7 @@ switch _option do { _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirements; + } count _requirements; if (_proceed) then { player playActionNow "Medic"; @@ -91,8 +91,8 @@ switch _option do { _temp_removed_array set [count _temp_removed_array,_x]; }; }; - } forEach magazines player; - } forEach _requirements; + } count magazines player; + } count _requirements; // all required items removed from player gear if (_tobe_removed_total == _removed_total) then { @@ -100,7 +100,7 @@ switch _option do { PVDZE_maintainArea = [player,1,_target]; publicVariableServer "PVDZE_maintainArea"; } else { - {player addMagazine _x;} forEach _temp_removed_array; + {player addMagazine _x;} count _temp_removed_array; cutText [format[(localize "STR_EPOCH_ACTIONS_5"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; } else { @@ -115,10 +115,10 @@ switch _option do { _countIn = _x select 1; _itemText = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName"); if (_cost != "") then { - _cost = _cost + " and "; + _cost = _cost + " && "; }; _cost = _cost + (str(_countIn) + " of " + _itemText); - } forEach _requirements; + } count _requirements; cutText [format[(localize "STR_EPOCH_ACTIONS_7"), _count, _cost], "PLAIN DOWN"]; }; }; diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index db1f74e06..dbf0cd740 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -80,7 +80,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> }; }; }; -} forEach _needNear; +} count _needNear; if(_abort) exitWith { @@ -132,24 +132,24 @@ _findNearestPole = []; if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; -} foreach _findNearestPoles; +} count _findNearestPoles; _IsNearPlot = count (_findNearestPole); -// If item is plot pole and another one exists within 45m -if(_isPole and _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; }; +// If item is plot pole && another one exists within 45m +if(_isPole && _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; }; if(_IsNearPlot == 0) then { // Allow building of plot - if(_requireplot == 0 or _isLandFireDZ) then { + if(_requireplot == 0 || _isLandFireDZ) then { _canBuildOnPlot = true; }; } else { - // Since there are plots nearby we check for ownership and then for friend status + // Since there are plots nearby we check for ownership && then for friend status - // check nearby plots ownership and then for friend status + // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner @@ -184,7 +184,7 @@ _hasrequireditem = true; { _hastoolweapon = _x in weapons player; if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); } -} forEach _require; +} count _require; _hasbuilditem = _this in magazines player; if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; }; @@ -301,7 +301,7 @@ if (_hasrequireditem) then { _object setDir (getDir _object); - if((_isAllowedUnderGround == 0) and ((_position select 2) < 0)) then { + if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then { _position set [2,0]; }; @@ -337,7 +337,7 @@ if (_hasrequireditem) then { if(abs(_objHDiff) > 5) exitWith { _isOk = false; _cancel = true; - _reason = "Cannot move up or down more than 5 meters"; + _reason = "Cannot move up || down more than 5 meters"; detach _object; deleteVehicle _object; }; @@ -379,7 +379,7 @@ if (_hasrequireditem) then { // Get position based on object _location = _position; - if((_isAllowedUnderGround == 0) and ((_location select 2) < 0)) then { + if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then { _location set [2,0]; }; @@ -424,11 +424,11 @@ if (_hasrequireditem) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; - if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then { + if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then { r_doLoop = false; }; if (DZE_cancelBuilding) exitWith { diff --git a/SQF/dayz_code/actions/player_buildingDowngrade.sqf b/SQF/dayz_code/actions/player_buildingDowngrade.sqf index e27b47091..b13f7874c 100644 --- a/SQF/dayz_code/actions/player_buildingDowngrade.sqf +++ b/SQF/dayz_code/actions/player_buildingDowngrade.sqf @@ -21,7 +21,7 @@ _findNearestPole = []; if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; -} foreach _findNearestPoles; +} count _findNearestPoles; _IsNearPlot = count (_findNearestPole); @@ -31,7 +31,7 @@ if(_IsNearPlot == 0) then { _canBuildOnPlot = true; } else { - // check nearby plots ownership and then for friend status + // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner @@ -110,7 +110,7 @@ if ((count _upgrade) > 0) then { if (_abortInvAdd) exitWith {}; - } forEach _refund; + } count _refund; // all parts added proceed if(_i != 0) then { @@ -150,7 +150,7 @@ if ((count _upgrade) > 0) then { cutText [format[(localize "str_epoch_player_143"), _i,(getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName"))], "PLAIN DOWN"]; { [player,(_x select 0),(_x select 1)] call BIS_fnc_invRemove; - } forEach _addedItems; + } count _addedItems; }; diff --git a/SQF/dayz_code/actions/player_buildingMaint.sqf b/SQF/dayz_code/actions/player_buildingMaint.sqf index 291ae5253..6478335da 100644 --- a/SQF/dayz_code/actions/player_buildingMaint.sqf +++ b/SQF/dayz_code/actions/player_buildingMaint.sqf @@ -45,7 +45,7 @@ _proceed = true; _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; -} forEach _requirements; +} count _requirements; if (_proceed) then { [1,1] call dayz_HungerThirst; @@ -73,9 +73,9 @@ if (_proceed) then { }; }; - } forEach magazines player; + } count magazines player; - } forEach _requirements; + } count _requirements; // all parts removed proceed if (_tobe_removed_total == _removed_total) then { @@ -86,7 +86,7 @@ if (_proceed) then { } else { - {player addMagazine _x;} forEach _temp_removed_array; + {player addMagazine _x;} count _temp_removed_array; cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; diff --git a/SQF/dayz_code/actions/player_copyKey.sqf b/SQF/dayz_code/actions/player_copyKey.sqf index 9ca640eeb..62222e7cd 100644 --- a/SQF/dayz_code/actions/player_copyKey.sqf +++ b/SQF/dayz_code/actions/player_copyKey.sqf @@ -42,7 +42,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/player_countmagazines.sqf b/SQF/dayz_code/actions/player_countmagazines.sqf index d8722bd16..f460c7e9d 100644 --- a/SQF/dayz_code/actions/player_countmagazines.sqf +++ b/SQF/dayz_code/actions/player_countmagazines.sqf @@ -1,6 +1,6 @@ /* count player magazines with ammo count -value = call player_countMagazines; //must be called from a spawned thread (or use spawn) +value = call player_countMagazines; //must be called from a spawned thread (|| use spawn) return all player magazines with ammo count Modified to save backpack magazine count by icomrade - Base for fix by Ziellos2k */ diff --git a/SQF/dayz_code/actions/player_craftItem.sqf b/SQF/dayz_code/actions/player_craftItem.sqf index 382f247a9..539937537 100644 --- a/SQF/dayz_code/actions/player_craftItem.sqf +++ b/SQF/dayz_code/actions/player_craftItem.sqf @@ -1,6 +1,6 @@ /* DayZ Epoch Crafting 0.3 - Made for DayZ Epoch and Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. + Made for DayZ Epoch && Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. Thanks to thevisad for help with the spawn call fixes. USAGE EXAMPLE: @@ -9,7 +9,7 @@ class ItemActions class Crafting { text = "Craft Tent"; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; // [Class of itemaction,CfgMagazines or CfgWeapons, item] + script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; // [Class of itemaction,CfgMagazines || CfgWeapons, item] neednearby[] = {"workshop","fire"}; requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only) output[] = {{"ItemTent",1}}; // (CfgMagazines, qty) @@ -39,7 +39,7 @@ _reason = ""; _waterLevel = 0; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); +_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); // Need Near Requirements _needNear = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "neednearby"); @@ -95,7 +95,7 @@ if (_canDo) then { { _hastoolweapon = _x in weapons player; if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; }; - } forEach _selectedRecipeTools; + } count _selectedRecipeTools; if(!_missingTools) then { @@ -111,7 +111,7 @@ if (_canDo) then { if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _selectedRecipeInput; + } count _selectedRecipeInput; }; // If all parts proceed @@ -137,7 +137,7 @@ if (_canDo) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -173,7 +173,7 @@ if (_canDo) then { }; }; }; - } forEach magazines player; + } count magazines player; { _configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)); @@ -194,9 +194,9 @@ if (_canDo) then { _temp_removed_array set [count _temp_removed_array,_x]; }; }; - } forEach magazines player; + } count magazines player; - } forEach _selectedRecipeInput; + } count _selectedRecipeInput; //diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total]; @@ -205,7 +205,7 @@ if (_canDo) then { _num_removed_weapons = 0; { _num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove); - } forEach _inputWeapons; + } count _inputWeapons; if (_num_removed_weapons == (count _inputWeapons)) then { if(_randomOutput == 1) then { _outputWeapons = []; @@ -223,7 +223,7 @@ if (_canDo) then { }; { player addWeapon _x; - } forEach _outputWeapons; + } count _outputWeapons; { _itemOut = _x select 0; @@ -250,14 +250,14 @@ if (_canDo) then { // sleep here sleep 1; - } forEach _selectedRecipeOutput; + } count _selectedRecipeOutput; _tradeComplete = _tradeComplete+1; }; } else { // Refund parts since we failed - {player addMagazine _x;} forEach _temp_removed_array; + {player addMagazine _x;} count _temp_removed_array; cutText [format[(localize "str_epoch_player_151"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; diff --git a/SQF/dayz_code/actions/player_drink.sqf b/SQF/dayz_code/actions/player_drink.sqf index 2176dc74c..5eaf17910 100644 --- a/SQF/dayz_code/actions/player_drink.sqf +++ b/SQF/dayz_code/actions/player_drink.sqf @@ -19,7 +19,7 @@ _invehicle = false; _config = configFile >> "CfgMagazines" >> _itemorignal; _text = getText (_config >> "displayName"); -//getting type of sfx (now just drink od soda open and drink) +//getting type of sfx (now just drink od soda open && drink) _sfx = getText (_config >> "sfx"); if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]}; @@ -35,14 +35,14 @@ if (vehicle player != player) then { sleep 1; if (["ItemWaterbottle",_itemorignal] call fnc_inString) then { - //low alert and sound radius + //low alert && sound radius _dis=5; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; player addMagazine "ItemWaterbottleUnfilled"; }; if (["ItemSoda",_itemorignal] call fnc_inString) then { - //higher alert and sound radius + //higher alert && sound radius _dis=10; [player,_sfx,0,false,_dis] call dayz_zombieSpeak; [player,_dis,true,(getPosATL player)] spawn player_alertZombies; @@ -71,7 +71,7 @@ if (_hasoutput && _invehicle) then { }; //add infection chance for "ItemWaterbottle", -if ((random 15 < 1) and (_itemorignal == "ItemWaterbottle")) then { +if ((random 15 < 1) && (_itemorignal == "ItemWaterbottle")) then { r_player_infected = true; player setVariable["USEC_infected",true,true]; }; diff --git a/SQF/dayz_code/actions/player_eat.sqf b/SQF/dayz_code/actions/player_eat.sqf index 38ec94dfb..2f2a26297 100644 --- a/SQF/dayz_code/actions/player_eat.sqf +++ b/SQF/dayz_code/actions/player_eat.sqf @@ -70,12 +70,12 @@ if (_hasoutput && _invehicle) then { (vehicle player) addMagazineCargoGlobal [_itemtodrop,1]; }; -if (_rawfood and !_rawexceptions and (random 15 < 1)) then { +if (_rawfood && !_rawexceptions && (random 15 < 1)) then { r_player_infected = true; player setVariable["USEC_infected",true,true]; }; -if (_badfood and (random 2 < 1)) then { +if (_badfood && (random 2 < 1)) then { r_player_infected = true; player setVariable["USEC_infected",true,true]; }; diff --git a/SQF/dayz_code/actions/player_findLights.sqf b/SQF/dayz_code/actions/player_findLights.sqf index f1b4d1b0c..0d3c23a2f 100644 --- a/SQF/dayz_code/actions/player_findLights.sqf +++ b/SQF/dayz_code/actions/player_findLights.sqf @@ -21,4 +21,4 @@ _findNearestlight = []; }; }; -} foreach nearestObjects [([player] call FNC_getPos), [], 20]; +} count nearestObjects [([player] call FNC_getPos), [], 20]; diff --git a/SQF/dayz_code/actions/player_goFishing.sqf b/SQF/dayz_code/actions/player_goFishing.sqf index 998bbbe5c..b7f0b4a13 100644 --- a/SQF/dayz_code/actions/player_goFishing.sqf +++ b/SQF/dayz_code/actions/player_goFishing.sqf @@ -31,7 +31,7 @@ r_interrupt = false; while {_isOk} do { - if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then { + if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then { _isOk = false; cutText [(localize "str_epoch_player_68"), "PLAIN DOWN"]; } else { diff --git a/SQF/dayz_code/actions/player_harvestPlant.sqf b/SQF/dayz_code/actions/player_harvestPlant.sqf index d65c45b41..43b784b1c 100644 --- a/SQF/dayz_code/actions/player_harvestPlant.sqf +++ b/SQF/dayz_code/actions/player_harvestPlant.sqf @@ -39,7 +39,7 @@ _findNearestTree = []; }; }; -} foreach nearestObjects [([player] call FNC_getPos), [], 10]; +} count nearestObjects [([player] call FNC_getPos), [], 10]; //diag_log format["DEBUG TREES: %1", _findNearestTree]; @@ -68,7 +68,7 @@ if (count(_findNearestTree) >= 1) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; [player,"chopwood",0,false] call dayz_zombieSpeak; diff --git a/SQF/dayz_code/actions/player_heliLift.sqf b/SQF/dayz_code/actions/player_heliLift.sqf index 66f1008ea..24dd0778f 100644 --- a/SQF/dayz_code/actions/player_heliLift.sqf +++ b/SQF/dayz_code/actions/player_heliLift.sqf @@ -38,7 +38,7 @@ while {r_doLoop} do { _height = (_posL select 2) - (_posC select 2); /* if(_height < 20) then { - if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then { + if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then { _moved = true; }; } else { @@ -57,7 +57,7 @@ while {r_doLoop} do { r_doLoop = false; _finished = true; }; - if (r_interrupt or _moved or (typeName _attached == "OBJECT") or (typeName _hasAttached == "OBJECT")) then { + if (r_interrupt || _moved || (typeName _attached == "OBJECT") || (typeName _hasAttached == "OBJECT")) then { r_doLoop = false; }; sleep 0.1; @@ -90,10 +90,10 @@ if(_finished) then { player playActionNow "stop"; cutText [format["the lift heli moved to much from the vehicle that was being lifted!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt } else { - if((typeName _attached == "OBJECT") or (typeName _hasAttached == "OBJECT")) then { + if((typeName _attached == "OBJECT") || (typeName _hasAttached == "OBJECT")) then { player switchMove ""; player playActionNow "stop"; - cutText [format["Another vehicle was attached or the vehicle was attached to another heli!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt + cutText [format["Another vehicle was attached || the vehicle was attached to another heli!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt } else { r_interrupt = false; player switchMove ""; diff --git a/SQF/dayz_code/actions/player_reloadMags.sqf b/SQF/dayz_code/actions/player_reloadMags.sqf index ccfe01743..202a3b377 100644 --- a/SQF/dayz_code/actions/player_reloadMags.sqf +++ b/SQF/dayz_code/actions/player_reloadMags.sqf @@ -91,10 +91,10 @@ _qtynew_create_mags_full = floor(_qtynew_create_ammo/_create_magsize); _qtynew_consume_ammo_rest = _qtynew_consume_ammo - (_qtynew_consume_mags_full*_consume_magsize); _qtynew_create_ammo_rest = _qtynew_create_ammo - (_qtynew_create_mags_full*_create_magsize); -// abort if no complete mags or partial mag is less than 15% full -if(_qtynew_create_ammo_rest > 0 and _qtynew_create_ammo_rest < (_create_magsize*0.85)) exitWith { cutText [(localize "str_epoch_player_81"), "PLAIN DOWN"]; }; +// abort if no complete mags || partial mag is less than 15% full +if(_qtynew_create_ammo_rest > 0 && _qtynew_create_ammo_rest < (_create_magsize*0.85)) exitWith { cutText [(localize "str_epoch_player_81"), "PLAIN DOWN"]; }; -//remove all _consume and _create mags (we already have total ammo count) +//remove all _consume && _create mags (we already have total ammo count) player removeMagazines _consume; player removeMagazines _create; diff --git a/SQF/dayz_code/actions/player_upgrade.sqf b/SQF/dayz_code/actions/player_upgrade.sqf index 05289eba6..04d4bf120 100644 --- a/SQF/dayz_code/actions/player_upgrade.sqf +++ b/SQF/dayz_code/actions/player_upgrade.sqf @@ -22,7 +22,7 @@ _findNearestPole = []; if (alive _x) then { _findNearestPole set [(count _findNearestPole),_x]; }; -} foreach _findNearestPoles; +} count _findNearestPoles; _IsNearPlot = count (_findNearestPole); @@ -32,7 +32,7 @@ if(_IsNearPlot == 0) then { _canBuildOnPlot = true; } else { - // check nearby plots ownership and then for friend status + // check nearby plots ownership && then for friend status _nearestPole = _findNearestPole select 0; // Find owner @@ -95,7 +95,7 @@ if ((count _upgrade) > 0) then { _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirements; + } count _requirements; if (_proceed) then { [1,1] call dayz_HungerThirst; @@ -123,9 +123,9 @@ if ((count _upgrade) > 0) then { }; }; - } forEach magazines player; + } count magazines player; - } forEach _requirements; + } count _requirements; // all parts removed proceed if (_tobe_removed_total == _removed_total) then { @@ -171,7 +171,7 @@ if ((count _upgrade) > 0) then { } else { - {player addMagazine _x;} forEach _temp_removed_array; + {player addMagazine _x;} count _temp_removed_array; cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; diff --git a/SQF/dayz_code/actions/pzombie/pz_attack.sqf b/SQF/dayz_code/actions/pzombie/pz_attack.sqf index 513d40f2c..5fc5b14e5 100644 --- a/SQF/dayz_code/actions/pzombie/pz_attack.sqf +++ b/SQF/dayz_code/actions/pzombie/pz_attack.sqf @@ -10,7 +10,7 @@ if (!isNull cursorTarget) then { if(player distance _ent < 5) then { - if (_ent isKindOf "Animal" or _isZombie) then { + if (_ent isKindOf "Animal" || _isZombie) then { _ent setDamage 1; } else { /* PVS/PVC - Skaronator */ diff --git a/SQF/dayz_code/actions/pzombie/pz_feed.sqf b/SQF/dayz_code/actions/pzombie/pz_feed.sqf index 0c42a8f84..62514fba2 100644 --- a/SQF/dayz_code/actions/pzombie/pz_feed.sqf +++ b/SQF/dayz_code/actions/pzombie/pz_feed.sqf @@ -69,7 +69,7 @@ if(!(alive _item)) then { [player,"eat",0,false] call dayz_zombieSpeak; - // todo: dump loot on ground and then remove + // todo: dump loot on ground && then remove //Ensure Control is visible _display = uiNamespace getVariable 'DAYZ_GUI_display'; diff --git a/SQF/dayz_code/actions/pzombie/pz_vision_rbg1.sqf b/SQF/dayz_code/actions/pzombie/pz_vision_rbg1.sqf index 1d12aa35c..f8073defa 100644 --- a/SQF/dayz_code/actions/pzombie/pz_vision_rbg1.sqf +++ b/SQF/dayz_code/actions/pzombie/pz_vision_rbg1.sqf @@ -18,7 +18,7 @@ _index = 0; _NV set [_index,(_NV select _index) + _x]; _index =_index + 1; -} forEach _increase; +} count _increase; // set rgb + m player setVariable [_NVx, _NV]; diff --git a/SQF/dayz_code/actions/refuel.sqf b/SQF/dayz_code/actions/refuel.sqf index 2a6aad7e2..6c8d1f34f 100644 --- a/SQF/dayz_code/actions/refuel.sqf +++ b/SQF/dayz_code/actions/refuel.sqf @@ -16,7 +16,7 @@ _nameText = getText(_configVeh >> "displayName"); // _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"]; _availableCans = ["ItemJerrycan","ItemFuelBarrel"]; -// Loop to find containers that can could hold fuel and fill them +// Loop to find containers that can could hold fuel && fill them { _configCan = configFile >> "CfgMagazines" >> _x; @@ -61,7 +61,7 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"]; if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -146,6 +146,6 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"]; // exit if abort flag was set if(_abort) exitWith {}; -} forEach magazines player; +} count magazines player; DZE_ActionInProgress = false; \ No newline at end of file diff --git a/SQF/dayz_code/actions/remove.sqf b/SQF/dayz_code/actions/remove.sqf index 9bb9744d7..7a4365aaf 100644 --- a/SQF/dayz_code/actions/remove.sqf +++ b/SQF/dayz_code/actions/remove.sqf @@ -47,7 +47,7 @@ else { _findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30]; _findNearestPole = []; -{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles; +{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} count _findNearestPoles; _IsNearPlot = count (_findNearestPole); @@ -109,7 +109,7 @@ while {_isOk} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; _sfx = "repair"; @@ -131,7 +131,7 @@ while {_isOk} do { if(_finished) then { _counter = _counter + 1; // 10% chance to break a required tool each pass - if((_isDestructable or _isRemovable) and !_isOwnerOfObj) then { + if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then { if((random 10) <= 1) then { _brokenTool = true; }; @@ -217,7 +217,7 @@ if (_proceed) then { }; // give refund items - if((count _selectedRemoveOutput) > 0 and !_preventRefund) then { + if((count _selectedRemoveOutput) > 0 && !_preventRefund) then { _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; { _itemOut = _x select 0; @@ -226,7 +226,7 @@ if (_proceed) then { _countOut = round((random (_countOut select 1)) + (_countOut select 0)); }; _item addMagazineCargoGlobal [_itemOut,_countOut]; - } forEach _selectedRemoveOutput; + } count _selectedRemoveOutput; _item setposATL _iPos; diff --git a/SQF/dayz_code/actions/repair.sqf b/SQF/dayz_code/actions/repair.sqf index 955007183..0000db2b0 100644 --- a/SQF/dayz_code/actions/repair.sqf +++ b/SQF/dayz_code/actions/repair.sqf @@ -20,7 +20,7 @@ _namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName"); s_player_repair_crtl = 1; -if (_section and _hasToolbox) then { +if (_section && _hasToolbox) then { [1,1] call dayz_HungerThirst; player playActionNow "Medic"; @@ -42,7 +42,7 @@ if (_section and _hasToolbox) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -70,7 +70,7 @@ if (_section and _hasToolbox) then { //Fix the part _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name"); - //vehicle is owned by whoever is in it, so we have to have each client try and fix it + //vehicle is owned by whoever is in it, so we have to have each client try && fix it PVDZE_veh_SFix = [_vehicle,_selection,0]; publicVariable "PVDZE_veh_SFix"; if (local _vehicle) then { @@ -99,7 +99,7 @@ if (_section and _hasToolbox) then { cutText [format[(localize "str_epoch_player_167"),_namePart], "PLAIN DOWN"]; }; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; dayz_myCursorTarget = objNull; //check if repaired fully @@ -110,7 +110,7 @@ _allFixed = true; if (_damage > 0) exitWith { _allFixed = false; }; -} forEach _hitpoints; +} count _hitpoints; //update if repaired if (_allFixed) then { diff --git a/SQF/dayz_code/actions/repair_cancel.sqf b/SQF/dayz_code/actions/repair_cancel.sqf index 848d2d043..6a527ef04 100644 --- a/SQF/dayz_code/actions/repair_cancel.sqf +++ b/SQF/dayz_code/actions/repair_cancel.sqf @@ -1,4 +1,4 @@ private []; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; s_player_repair_crtl = -1; dayz_myCursorTarget = objNull; \ No newline at end of file diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index 00efd1914..2bbd5501c 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -2,7 +2,7 @@ private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle"," _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; // dayz_myCursorTarget = _vehicle; _allFixed = true; @@ -53,7 +53,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; s_player_repairActions set [count s_player_repairActions,_handle]; }; -} forEach _hitpoints; +} count _hitpoints; if (_allFixed) then { _vehicle setDamage 0; }; diff --git a/SQF/dayz_code/actions/salvage.sqf b/SQF/dayz_code/actions/salvage.sqf index 4f093a340..952f0d739 100644 --- a/SQF/dayz_code/actions/salvage.sqf +++ b/SQF/dayz_code/actions/salvage.sqf @@ -20,7 +20,7 @@ _hasToolbox = "ItemToolbox" in items player; _nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); _namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName"); -{_vehicle removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{_vehicle removeAction _x} count s_player_repairActions;s_player_repairActions = []; s_player_repair_crtl = 1; if (_hasToolbox) then { @@ -43,7 +43,7 @@ if (_hasToolbox) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -77,7 +77,7 @@ if (_hasToolbox) then { //break the part _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name"); - //vehicle is owned by whoever is in it, so we have to have each client try and fix it + //vehicle is owned by whoever is in it, so we have to have each client try && fix it //["PVDZE_veh_SFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal; PVDZE_veh_SFix = [_vehicle,_selection,1]; diff --git a/SQF/dayz_code/actions/salvage_vehicle.sqf b/SQF/dayz_code/actions/salvage_vehicle.sqf index e65c602e9..808915101 100644 --- a/SQF/dayz_code/actions/salvage_vehicle.sqf +++ b/SQF/dayz_code/actions/salvage_vehicle.sqf @@ -2,7 +2,7 @@ private ["_part","_cancel","_color","_percent","_string","_handle","_damage","_c _vehicle = _this select 3; -{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; +{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; // dayz_myCursorTarget = _vehicle; // _allFixed = true; @@ -40,10 +40,10 @@ _hitpoints = _vehicle call vehicle_getHitpoints; }; // allow removal of any lightly damaged parts - if (_damage < 1 and _damage > 0) then { + if (_damage < 1 && _damage > 0) then { - // Do not allow removal of engine or fueltanks - if( _part == "PartGlass" or _part == "PartWheel" ) then { + // Do not allow removal of engine || fueltanks + if( _part == "PartGlass" || _part == "PartWheel" ) then { _color = "color='#ffff00'"; //yellow if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange @@ -57,7 +57,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints; }; }; -} forEach _hitpoints; +} count _hitpoints; if(count _hitpoints > 0 ) then { diff --git a/SQF/dayz_code/actions/show_dialog.sqf b/SQF/dayz_code/actions/show_dialog.sqf index f1cfe8bf4..1c5ed5351 100644 --- a/SQF/dayz_code/actions/show_dialog.sqf +++ b/SQF/dayz_code/actions/show_dialog.sqf @@ -18,7 +18,7 @@ TraderCatList = []; private ["_index", "_x"]; _index = lbAdd [TraderDialogCatList, _x select 0]; TraderCatList set [count TraderCatList, _x select 1]; -} forEach _trader_data; +} count _trader_data; waitUntil { !dialog }; TraderCurrentCatIndex = -1; TraderCatList = -1; \ No newline at end of file diff --git a/SQF/dayz_code/actions/siphonFuel.sqf b/SQF/dayz_code/actions/siphonFuel.sqf index fa2a9945f..e8a10f4f5 100644 --- a/SQF/dayz_code/actions/siphonFuel.sqf +++ b/SQF/dayz_code/actions/siphonFuel.sqf @@ -16,7 +16,7 @@ _nameText = getText(_configVeh >> "displayName"); _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"]; // _availableCans = ["ItemJerrycan","ItemFuelBarrel"]; -// Loop to find containers that can could hold fuel and fill them +// Loop to find containers that can could hold fuel && fill them { _configCanEmpty = configFile >> "CfgMagazines" >> _x; //diag_log format["Looking for: %1", _x]; @@ -70,7 +70,7 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"]; if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -153,6 +153,6 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"]; // exit if abort flag was set if(_abort) exitWith {}; -} forEach magazines player; +} count magazines player; DZE_ActionInProgress = false; diff --git a/SQF/dayz_code/actions/stopGenerator.sqf b/SQF/dayz_code/actions/stopGenerator.sqf index 6c0cd153c..d34501d27 100644 --- a/SQF/dayz_code/actions/stopGenerator.sqf +++ b/SQF/dayz_code/actions/stopGenerator.sqf @@ -29,7 +29,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -51,7 +51,7 @@ if(!_finished) then { if (_finished) then { - // find sound and delete + // find sound && delete _soundObject = _vehicle getVariable "GeneratorSound"; deleteVehicle _soundObject; diff --git a/SQF/dayz_code/actions/tame_dog.sqf b/SQF/dayz_code/actions/tame_dog.sqf index 4a1ea6f78..f7425788e 100644 --- a/SQF/dayz_code/actions/tame_dog.sqf +++ b/SQF/dayz_code/actions/tame_dog.sqf @@ -28,7 +28,7 @@ _selected = ""; _removed = _removed + ([player,_x] call BIS_fnc_invRemove); }; if(_removed == 1) exitWith { _selected = _x; }; -} forEach magazines player; +} count magazines player; // Only proceed if removed count matches if(_removed == _countIn) then { diff --git a/SQF/dayz_code/actions/tent_pitch.sqf b/SQF/dayz_code/actions/tent_pitch.sqf index a9fc46f4c..116d7e262 100644 --- a/SQF/dayz_code/actions/tent_pitch.sqf +++ b/SQF/dayz_code/actions/tent_pitch.sqf @@ -29,7 +29,7 @@ _objectsPond = nearestObjects [_playerPos, [], 10]; _isOk = true; }; }; - } forEach _objectsPond; + } count _objectsPond; //diag_log ("Pitch Tent: " + str(_isok) ); diff --git a/SQF/dayz_code/actions/tow_AttachStraps.sqf b/SQF/dayz_code/actions/tow_AttachStraps.sqf index fed51a0cf..f78951c95 100644 --- a/SQF/dayz_code/actions/tow_AttachStraps.sqf +++ b/SQF/dayz_code/actions/tow_AttachStraps.sqf @@ -16,12 +16,12 @@ _allowedSize = _towTruckSize-(_towTruckSize/3); _findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10]; _findNearestVehicle = []; { - if (alive _x and _towTruck != _x) then { + if (alive _x && _towTruck != _x) then { if([_x,_towTruck] call fnc_isInsideBuilding2) then { _findNearestVehicle set [(count _findNearestVehicle),_x]; }; }; -} foreach _findNearestVehicles; +} count _findNearestVehicles; _IsNearVehicle = count (_findNearestVehicle); @@ -54,7 +54,7 @@ if(_IsNearVehicle >= 1) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -78,7 +78,7 @@ if(_IsNearVehicle >= 1) then { if (_finished) then { if((sizeOf typeOf _vehicle) <= _allowedSize) then { - if([_vehicle,_towTruck] call fnc_isInsideBuilding2 and ((vectorUp _vehicle) select 2) > 0.5) then { + if([_vehicle,_towTruck] call fnc_isInsideBuilding2 && ((vectorUp _vehicle) select 2) > 0.5) then { if(typeOf _towTruck == "TOW_DZE" ) then { _vehicle attachTo [_towTruck,[1.3,-2,2.3]]; _towTruck setVariable ["DZEinTow", true, true]; diff --git a/SQF/dayz_code/actions/tow_DetachStraps.sqf b/SQF/dayz_code/actions/tow_DetachStraps.sqf index 994d00fa2..e61314fb6 100644 --- a/SQF/dayz_code/actions/tow_DetachStraps.sqf +++ b/SQF/dayz_code/actions/tow_DetachStraps.sqf @@ -43,7 +43,7 @@ if(_inTow) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index bf2343f5d..977729b8b 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -43,7 +43,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -184,10 +184,10 @@ if (_finished) then { _tireDmg = _tireDmg + _damage; _tires = _tires + 1; }; - } forEach _hitpoints; + } count _hitpoints; // find average tire damage - if(_tireDmg > 0 and _tires > 0) then { + if(_tireDmg > 0 && _tires > 0) then { if((_tireDmg / _tires) > 0.75) then { _okToSell = false; }; @@ -198,7 +198,7 @@ if (_finished) then { _notSetup = (_objectID == "0" && _objectUID == "0"); - if(local _obj and !isNull _obj and alive _obj and !_notSetup) then { + if(local _obj && !isNull _obj && alive _obj && !_notSetup) then { if(_okToSell) then { diff --git a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf index 74e992e2b..b73b08c2b 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle_old.sqf @@ -49,7 +49,7 @@ if (_qty >= _qty_in) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -143,10 +143,10 @@ if (_qty >= _qty_in) then { _tireDmg = _tireDmg + _damage; _tires = _tires + 1; }; - } forEach _hitpoints; + } count _hitpoints; // find average tire damage - if(_tireDmg > 0 and _tires > 0) then { + if(_tireDmg > 0 && _tires > 0) then { if((_tireDmg / _tires) > 0.75) then { _okToSell = false; }; @@ -155,7 +155,7 @@ if (_qty >= _qty_in) then { if(_okToSell) then { - if(!isNull _obj and alive _obj) then { + if(!isNull _obj && alive _obj) then { for "_x" from 1 to _qty_out do { player addMagazine _part_out; @@ -179,7 +179,7 @@ if (_qty >= _qty_in) then { }; }; - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; } else { diff --git a/SQF/dayz_code/actions/trade_any_boat.sqf b/SQF/dayz_code/actions/trade_any_boat.sqf index 065e8762a..3ff95ff72 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -43,7 +43,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -134,7 +134,7 @@ if (_finished) then { waitUntil {!isNil "_isOk"}; - if (_isOk and _isKeyOK) then { + if (_isOk && _isKeyOK) then { _done = [[[_part_in,_qty_in]],0] call epoch_returnChange; if (_done) then { @@ -193,7 +193,7 @@ if (_finished) then { _notSetup = (_objectID == "0" && _objectUID == "0"); - if(local _obj and !isNull _obj and alive _obj and !_notSetup) then { + if(local _obj && !isNull _obj && alive _obj && !_notSetup) then { PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; diff --git a/SQF/dayz_code/actions/trade_any_boat_old.sqf b/SQF/dayz_code/actions/trade_any_boat_old.sqf index 706368507..42c8d2c0f 100644 --- a/SQF/dayz_code/actions/trade_any_boat_old.sqf +++ b/SQF/dayz_code/actions/trade_any_boat_old.sqf @@ -50,7 +50,7 @@ if (_qty >= _qty_in) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -112,7 +112,7 @@ if (_qty >= _qty_in) then { _config = _keySelected; _isOk = [player,_config] call BIS_fnc_invAdd; waitUntil {!isNil "_isOk"}; - if (_isOk and _isKeyOK) then { + if (_isOk && _isKeyOK) then { _removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove); if(_removed == _qty_in) then { @@ -152,7 +152,7 @@ if (_qty >= _qty_in) then { _okToSell = false; }; - if(_okToSell and !isNull _obj and alive _obj) then { + if(_okToSell && !isNull _obj && alive _obj) then { for "_x" from 1 to _qty_out do { player addMagazine _part_out; @@ -172,7 +172,7 @@ if (_qty >= _qty_in) then { }; }; - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; } else { diff --git a/SQF/dayz_code/actions/trade_any_vehicle.sqf b/SQF/dayz_code/actions/trade_any_vehicle.sqf index 55486bb91..559baffdb 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -43,7 +43,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -134,7 +134,7 @@ if (_finished) then { waitUntil {!isNil "_isOk"}; - if (_isOk and _isKeyOK) then { + if (_isOk && _isKeyOK) then { _done = [[[_part_in,_qty_in]],0] call epoch_returnChange; if (_done) then { @@ -205,10 +205,10 @@ if (_finished) then { _tireDmg = _tireDmg + _damage; _tires = _tires + 1; }; - } forEach _hitpoints; + } count _hitpoints; // find average tire damage - if(_tireDmg > 0 and _tires > 0) then { + if(_tireDmg > 0 && _tires > 0) then { if((_tireDmg / _tires) > 0.75) then { _okToSell = false; }; @@ -220,7 +220,7 @@ if (_finished) then { _notSetup = (_objectID == "0" && _objectUID == "0"); - if(local _obj and !isNull _obj and alive _obj and !_notSetup) then { + if(local _obj && !isNull _obj && alive _obj && !_notSetup) then { if(_okToSell) then { @@ -240,7 +240,7 @@ if (_finished) then { [_activatingPlayer,_x] call BIS_fnc_invRemove; }; }; - } forEach (items _activatingPlayer); + } count (items _activatingPlayer); // payout _canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange; diff --git a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf index cd393e8f3..c62f91fa7 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_free.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_free.sqf @@ -43,7 +43,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -182,10 +182,10 @@ if (_finished) then { _tireDmg = _tireDmg + _damage; _tires = _tires + 1; }; - } forEach _hitpoints; + } count _hitpoints; // find average tire damage - if(_tireDmg > 0 and _tires > 0) then { + if(_tireDmg > 0 && _tires > 0) then { if((_tireDmg / _tires) > 0.75) then { _okToSell = false; }; @@ -196,7 +196,7 @@ if (_finished) then { _notSetup = (_objectID == "0" && _objectUID == "0"); - if(local _obj and !isNull _obj and alive _obj and !_notSetup) then { + if(local _obj && !isNull _obj && alive _obj && !_notSetup) then { if(_okToSell) then { diff --git a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf index 38a17c997..7dd98c093 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle_old.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle_old.sqf @@ -54,7 +54,7 @@ if (_qty >= _qty_in) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -120,7 +120,7 @@ if (_qty >= _qty_in) then { _config = _keySelected; _isOk = [player,_config] call BIS_fnc_invAdd; waitUntil {!isNil "_isOk"}; - if (_isOk and _isKeyOK) then { + if (_isOk && _isKeyOK) then { _removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove); if(_removed == _qty_in) then { @@ -170,16 +170,16 @@ if (_qty >= _qty_in) then { _tireDmg = _tireDmg + _damage; _tires = _tires + 1; }; - } forEach _hitpoints; + } count _hitpoints; // find average tire damage - if(_tireDmg > 0 and _tires > 0) then { + if(_tireDmg > 0 && _tires > 0) then { if((_tireDmg / _tires) > 0.75) then { _okToSell = false; }; }; - if(local _obj and !isNull _obj and alive _obj) then { + if(local _obj && !isNull _obj && alive _obj) then { if(_okToSell) then { @@ -206,7 +206,7 @@ if (_qty >= _qty_in) then { }; - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; } else { diff --git a/SQF/dayz_code/actions/trade_backpacks.sqf b/SQF/dayz_code/actions/trade_backpacks.sqf index 939b3f319..60f6f03d3 100644 --- a/SQF/dayz_code/actions/trade_backpacks.sqf +++ b/SQF/dayz_code/actions/trade_backpacks.sqf @@ -40,7 +40,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/trade_backpacks_old.sqf b/SQF/dayz_code/actions/trade_backpacks_old.sqf index 6f9b74167..e84c1db6e 100644 --- a/SQF/dayz_code/actions/trade_backpacks_old.sqf +++ b/SQF/dayz_code/actions/trade_backpacks_old.sqf @@ -48,7 +48,7 @@ if (_qty >= _qty_in) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -117,7 +117,7 @@ if (_qty >= _qty_in) then { cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; } else { diff --git a/SQF/dayz_code/actions/trade_cancel.sqf b/SQF/dayz_code/actions/trade_cancel.sqf index cfff7ef20..0b77bb82b 100644 --- a/SQF/dayz_code/actions/trade_cancel.sqf +++ b/SQF/dayz_code/actions/trade_cancel.sqf @@ -1,3 +1,3 @@ private []; -{player removeAction _x} forEach s_player_parts;s_player_parts = []; +{player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; \ No newline at end of file diff --git a/SQF/dayz_code/actions/trade_items.sqf b/SQF/dayz_code/actions/trade_items.sqf index 4c88d603f..0815f385a 100644 --- a/SQF/dayz_code/actions/trade_items.sqf +++ b/SQF/dayz_code/actions/trade_items.sqf @@ -81,7 +81,7 @@ while {r_autoTrade} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/trade_items_old.sqf b/SQF/dayz_code/actions/trade_items_old.sqf index dadb13b30..ae3c58d39 100644 --- a/SQF/dayz_code/actions/trade_items_old.sqf +++ b/SQF/dayz_code/actions/trade_items_old.sqf @@ -71,7 +71,7 @@ for "_x" from 1 to _total_trades do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/trade_items_wo_db.sqf b/SQF/dayz_code/actions/trade_items_wo_db.sqf index 917bfa0fb..bfc628e8c 100644 --- a/SQF/dayz_code/actions/trade_items_wo_db.sqf +++ b/SQF/dayz_code/actions/trade_items_wo_db.sqf @@ -56,7 +56,7 @@ for "_x" from 1 to _total_trades do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/actions/trade_metals.sqf b/SQF/dayz_code/actions/trade_metals.sqf index a125bad8d..4c2930b35 100644 --- a/SQF/dayz_code/actions/trade_metals.sqf +++ b/SQF/dayz_code/actions/trade_metals.sqf @@ -3,7 +3,7 @@ private ["_buy","_metals_conversion","_cancel"]; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -{player removeAction _x} forEach s_player_parts;s_player_parts = []; +{player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = 1; _metals_conversion = [ @@ -18,7 +18,7 @@ _metals_conversion = [ _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""]; s_player_parts set [count s_player_parts,_buy]; -} forEach _metals_conversion; +} count _metals_conversion; _cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""]; s_player_parts set [count s_player_parts,_cancel]; diff --git a/SQF/dayz_code/actions/trade_weapons.sqf b/SQF/dayz_code/actions/trade_weapons.sqf index fc70cc7fd..c2dd60f72 100644 --- a/SQF/dayz_code/actions/trade_weapons.sqf +++ b/SQF/dayz_code/actions/trade_weapons.sqf @@ -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; }; diff --git a/SQF/dayz_code/actions/trade_weapons_old.sqf b/SQF/dayz_code/actions/trade_weapons_old.sqf index 0b99f7d7f..ea232f252 100644 --- a/SQF/dayz_code/actions/trade_weapons_old.sqf +++ b/SQF/dayz_code/actions/trade_weapons_old.sqf @@ -49,7 +49,7 @@ if (_qty >= _qty_in) then { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -107,7 +107,7 @@ if (_qty >= _qty_in) then { - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; } else { diff --git a/SQF/dayz_code/actions/unlock_veh.sqf b/SQF/dayz_code/actions/unlock_veh.sqf index a9863e905..6fd5ac3ac 100644 --- a/SQF/dayz_code/actions/unlock_veh.sqf +++ b/SQF/dayz_code/actions/unlock_veh.sqf @@ -5,7 +5,7 @@ _key = (_this select 3) select 1; if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_37") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; +{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = []; s_player_lockUnlock_crtl = 1; PVDZE_veh_Lock = [_vehicle,false]; diff --git a/SQF/dayz_code/actions/vault_combination_1.sqf b/SQF/dayz_code/actions/vault_combination_1.sqf index 035a6fe99..b2f0fa37a 100644 --- a/SQF/dayz_code/actions/vault_combination_1.sqf +++ b/SQF/dayz_code/actions/vault_combination_1.sqf @@ -8,7 +8,7 @@ dayz_combination = ""; if(!isNull dayz_selectedVault) then { - if ((typeOf dayz_selectedVault) == "VaultStorageLocked" or (typeOf dayz_selectedVault) == "VaultStorage") then { + if ((typeOf dayz_selectedVault) == "VaultStorageLocked" || (typeOf dayz_selectedVault) == "VaultStorage") then { _ok = createdialog "SafeKeyPad"; } else { _ok = createdialog "KeypadUI"; diff --git a/SQF/dayz_code/actions/vault_pitch.sqf b/SQF/dayz_code/actions/vault_pitch.sqf index 74d1281ab..3f00e3a7b 100644 --- a/SQF/dayz_code/actions/vault_pitch.sqf +++ b/SQF/dayz_code/actions/vault_pitch.sqf @@ -101,7 +101,7 @@ _objectsPond = nearestObjects [_playerPos, [], 10]; _isOk = true; }; }; - } forEach _objectsPond; + } count _objectsPond; deleteVehicle _tmpvault; diff --git a/SQF/dayz_code/actions/veh_seatActions.sqf b/SQF/dayz_code/actions/veh_seatActions.sqf index b4c51f382..cb059f46b 100644 --- a/SQF/dayz_code/actions/veh_seatActions.sqf +++ b/SQF/dayz_code/actions/veh_seatActions.sqf @@ -1,6 +1,6 @@ /* - Created exclusively for ArmA2:OA - DayZMod and DayZ Epoch. Script by icomrade. - permission is required to use, alter and/or distribute from the author or project leader. + Created exclusively for ArmA2:OA - DayZMod && DayZ Epoch. Script by icomrade. + permission is required to use, alter &&/|| distribute from the author || project leader. */ private ["_array","_count","_action","_driver","_vehicle","_vehicleType","_emptySeat","_emptyGun"]; _array = _this select 3; @@ -14,7 +14,7 @@ _emptyGun = ((_vehicle emptyPositions "Gunner") - _count); switch _action do { case "MoveToPilot": { - if (((_vehicle emptyPositions "Driver") == 0) and (!alive _driver)) then { + if (((_vehicle emptyPositions "Driver") == 0) && (!alive _driver)) then { _driver action ["EJECT", _vehicle]; sleep 0.5; //wait for ejection }; diff --git a/SQF/dayz_code/actions/water_fill.sqf b/SQF/dayz_code/actions/water_fill.sqf index cba88a875..ccd0d0968 100644 --- a/SQF/dayz_code/actions/water_fill.sqf +++ b/SQF/dayz_code/actions/water_fill.sqf @@ -29,7 +29,7 @@ if (!_canFill) then { //Check for Well _isWell = ["_well",str(_x),false] call fnc_inString; if (_isWell) then {_canFill = true}; - } forEach _objectsWell; + } count _objectsWell; }; if (!_canFill) then { @@ -43,7 +43,7 @@ if (!_canFill) then { _canFill = true; }; }; - } forEach _objectsPond; + } count _objectsPond; }; if (_canFill) then { diff --git a/SQF/dayz_code/anim/saw_idle.rtm b/SQF/dayz_code/anim/saw_idle.rtm index 1044d61e20ee1d0d3f3cab6a9dedb0b7054700ba..384d76d7acb1c455c15c3d1e818707aa65011b52 100644 GIT binary patch delta 34 icmaEo@-St>K_)e|jYk4Gfz)Om`3T|71+p_4VH^PE@e2e1 delta 36 lcmaEu@+4)#!HEl{H{Q17WKPUW*~}>)A-p+Hb|xd72LLQE4axuj diff --git a/SQF/dayz_code/compile/BIS_fnc/fn_findNestedElement.sqf b/SQF/dayz_code/compile/BIS_fnc/fn_findNestedElement.sqf index c94253a08..01d6453d6 100644 --- a/SQF/dayz_code/compile/BIS_fnc/fn_findNestedElement.sqf +++ b/SQF/dayz_code/compile/BIS_fnc/fn_findNestedElement.sqf @@ -4,7 +4,7 @@ scriptName "Functions\arrays\fn_findNestedElement.sqf"; Author: Joris-Jan van 't Land Description: - Function to find item in nested arrays and return a path to the first match. + Function to find item in nested arrays && return a path to the first match. Example: _array = [[1, 2], [3, 4]]; @@ -27,7 +27,7 @@ _found = false; //Parameter checking. if ((typeName _array) != (typeName [])) exitWith {debugLog "Log: [findNestedElement] Array (0) should be an Array!"}; -//Find a value in an Array or one of its children. +//Find a value in an Array || one of its children. private ["_searchArrayFunc"]; _searchArrayFunc = { diff --git a/SQF/dayz_code/compile/BIS_fnc/fn_param.sqf b/SQF/dayz_code/compile/BIS_fnc/fn_param.sqf index 64d21e46d..ff1e878e8 100644 --- a/SQF/dayz_code/compile/BIS_fnc/fn_param.sqf +++ b/SQF/dayz_code/compile/BIS_fnc/fn_param.sqf @@ -7,19 +7,19 @@ Parameter(s): _this select 0: ARRAY - list of params _this select 1: NUMBER - selected index - _this select 2 (Optional): ANY - default param (used when param is missing or of wrong type) + _this select 2 (Optional): ANY - default param (used when param is missing || of wrong type) - you can overload default value by setting 'BIS_fnc__' _this select 3 (Optional): ARRAY - list of allowed type examples (e.g. ["",[],0,objnull]) _this select 4 (Optional): NUMBER - If value is ARRAY, checks if it has required number of elements Returns: - ANY - either value from list of params, or default value + ANY - either value from list of params, || default value */ /////////////////////////////////////////////////////////////////////////////////////////////////////////// private ["_params","_id","_value","_thisCount"]; -//disableserialization; //--- Do not put this here or none of the scripts where BIS_fnc_param is used will be serialized! +//disableserialization; //--- Do not put this here || none of the scripts where BIS_fnc_param is used will be serialized! _thisCount = count _this; //if (typename _this != typename []) then {_this = [_this]}; diff --git a/SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf b/SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf index 017b60a63..e50970f5f 100644 --- a/SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf +++ b/SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf @@ -10,7 +10,7 @@ Operand types: : array : array -Returns a vector that is the sum of and . +Returns a vector that is the sum of && . ************************************************************/ diff --git a/SQF/dayz_code/compile/building_spawnLoot.sqf b/SQF/dayz_code/compile/building_spawnLoot.sqf index 4e36eb061..510f00048 100644 --- a/SQF/dayz_code/compile/building_spawnLoot.sqf +++ b/SQF/dayz_code/compile/building_spawnLoot.sqf @@ -20,7 +20,7 @@ _lootChance = getNumber (_config >> "lootChance"); //_countPositions = count _pos; _qty = 0; // effective quantity of spawned weaponholder -_lootSpawnBias = 67; //67 between 50 and 100. The lower it is, the lower chance some of the lootpiles will spawn +_lootSpawnBias = 67; //67 between 50 && 100. The lower it is, the lower chance some of the lootpiles will spawn // shuffles an array @@ -75,7 +75,7 @@ _bias = (_bias + random(100 - _bias)) / 100; }; }; }; -} forEach _positions; +} count _positions; // small loot _posSmall = [] + getArray (_config >> "lootPosSmall"); @@ -114,4 +114,4 @@ _positionsSmall = _posSmall call _ShuffleArray; }; }; }; -} forEach _positionsSmall; \ No newline at end of file +} count _positionsSmall; \ No newline at end of file diff --git a/SQF/dayz_code/compile/building_spawnZombies.sqf b/SQF/dayz_code/compile/building_spawnZombies.sqf index 376e978fe..62a8dded2 100644 --- a/SQF/dayz_code/compile/building_spawnZombies.sqf +++ b/SQF/dayz_code/compile/building_spawnZombies.sqf @@ -45,7 +45,7 @@ if (_canLoot) then { [_iPos,true,_unitTypes] call zombie_generate; }; }; - } forEach _positions; + } count _positions; } else { diff --git a/SQF/dayz_code/compile/dog_findTargetAgent.sqf b/SQF/dayz_code/compile/dog_findTargetAgent.sqf index b3f65991a..286375f46 100644 --- a/SQF/dayz_code/compile/dog_findTargetAgent.sqf +++ b/SQF/dayz_code/compile/dog_findTargetAgent.sqf @@ -16,7 +16,7 @@ if (count _targets > 0) then { _man = _x; _manDis = (_x distance _dog); }; - } forEach _targets; + } count _targets; _target = _man; }; _target; \ No newline at end of file diff --git a/SQF/dayz_code/compile/epoch_returnChange.sqf b/SQF/dayz_code/compile/epoch_returnChange.sqf index 91b63f835..027f33097 100644 --- a/SQF/dayz_code/compile/epoch_returnChange.sqf +++ b/SQF/dayz_code/compile/epoch_returnChange.sqf @@ -43,7 +43,7 @@ if (_canAfford) then { }; }; - } forEach (magazines player); + } count (magazines player); //diag_log format["DEBUG TRADER INPUT CURRENCY TOTAL: %1", _total_currency]; diff --git a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf index 8f74f754f..5d8425f4e 100644 --- a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf +++ b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf @@ -5,7 +5,7 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf"; Description: Function to select a random item from an array, taking into account item weights. - The weights should be Numbers between 0 and 1, with a maximum precision of hundreds. + The weights should be Numbers between 0 && 1, with a maximum precision of hundreds. Parameter(s): _this select 0: source Array (Array of Any Value) @@ -40,9 +40,9 @@ for "_i" from 0 to ((count _weights) - 1) do //If it's not, set weight to 0 to exclude it. if ((typeName _weight) != (typeName 0)) then {diag_log "Log: [selectRandomWeighted] Weights should be Numbers; weight set to 0!"; _weight = 0}; - //The weight should be a Number between 0 and 1. - if (_weight < 0) then {diag_log "Log: [selectRandomWeighted] Weights should be more than or equal to 0; weight set to 0!"; _weight = 0}; - //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than or equal to 1; weight set to 1!"; _weight = 1}; + //The weight should be a Number between 0 && 1. + if (_weight < 0) then {diag_log "Log: [selectRandomWeighted] Weights should be more than || equal to 0; weight set to 0!"; _weight = 0}; + //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than || equal to 1; weight set to 1!"; _weight = 1}; //Normalize the weight for a precision of hundreds. _weight = round(_weight * 100); diff --git a/SQF/dayz_code/compile/fn_checkItems.sqf b/SQF/dayz_code/compile/fn_checkItems.sqf index bc61a8200..dd94496a4 100644 --- a/SQF/dayz_code/compile/fn_checkItems.sqf +++ b/SQF/dayz_code/compile/fn_checkItems.sqf @@ -1,10 +1,10 @@ /* Description: -Checks whether the player has the required items (magazines) or not -and displays a message if an item is missing. +Checks whether the player has the required items (magazines) || not +&& displays a message if an item is missing. Parameter(s): -_this: list of item names the player is required to have (can also be an sub-array with item name and quantity) +_this: list of item names the player is required to have (can also be an sub-array with item name && quantity) Returns: Boolean (true if the player has all required items) @@ -41,5 +41,5 @@ _hasItems = true; _textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName"); cutText [format[(localize "STR_EPOCH_ACTIONS_12"), _missingQty, _textMissing], "PLAIN DOWN"]; }; -} forEach _items; +} count _items; _hasItems diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index 5f7b30f93..8e787903f 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -29,7 +29,7 @@ if (_inVehicle) then { r_player_lastSeat = _assignedRole; if ((_vehicle isKindOf "helicopter") || (_inVehicle && ({(isPlayer _x) && (alive _x)} count (crew _vehicle) > 1))) then { //allow switch to pilot - if (((_assignedRole select 0) != "driver") and ((!alive _driver) or ((_vehicle emptyPositions "Driver") > 0))) then { + if (((_assignedRole select 0) != "driver") && ((!alive _driver) || ((_vehicle emptyPositions "Driver") > 0))) then { if (_vehicle isKindOf "helicopter") then { _action = _vehicle addAction [localize "STR_EPOCH_PLAYER_308A", "\z\addons\dayz_code\actions\veh_seatActions.sqf",["MoveToPilot",_driver], 0, false, true]; } else { @@ -39,19 +39,19 @@ if (_inVehicle) then { r_action2 = true; }; //allow switch to cargo - if (((_assignedRole select 0) != "cargo") and ((_vehicle emptyPositions "Cargo") > 0)) then { + if (((_assignedRole select 0) != "cargo") && ((_vehicle emptyPositions "Cargo") > 0)) then { _action = _vehicle addAction [localize "STR_EPOCH_PLAYER_309", "\z\addons\dayz_code\actions\veh_seatActions.sqf",["MoveToCargo",_driver], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; }; //allow switch to gunner - if (((_assignedRole select 0) != "Turret") and ((_vehicle emptyPositions "Gunner") > 0)) then { + if (((_assignedRole select 0) != "Turret") && ((_vehicle emptyPositions "Gunner") > 0)) then { _action = _vehicle addAction [localize "STR_EPOCH_PLAYER_310", "\z\addons\dayz_code\actions\veh_seatActions.sqf",["MoveToTurret",_driver], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; }; //allow switch to commander - if (((assignedCommander _vehicle) != player) and ((_vehicle emptyPositions "Commander") > 0)) then { + if (((assignedCommander _vehicle) != player) && ((_vehicle emptyPositions "Commander") > 0)) then { _action = _vehicle addAction [localize "STR_EPOCH_PLAYER_311", "\z\addons\dayz_code\actions\veh_seatActions.sqf",["MoveToTurret",_driver], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; @@ -65,7 +65,7 @@ if (_inVehicle) then { _action = _vehicle addAction [format["Add AMMO to %1",_weaponName], "\z\addons\dayz_code\actions\ammo.sqf",[_vehicle,_x,_turret], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; - } forEach _weapons; + } count _weapons; }; }; } else { @@ -74,7 +74,7 @@ if (_inVehicle) then { r_player_lastSeat = []; }; -if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and _isClose) then { +if (!isNull _menClose && _hasPatient && !r_drag_sqf && !r_action && !_inVehicle && !r_player_unconscious && _isClose) then { _unit = cursorTarget; _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ"]; // player reveal _unit; @@ -110,12 +110,12 @@ if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehi r_player_actions = r_player_actions + [_action1,_action2]; }; //Load Vehicle - if (_hasVehicle and _unconscious) then { + if (_hasVehicle && _unconscious) then { _x = 0; r_action = true; _unit = _unit; _vehicle = (_vehClose select _x); - while{((!alive _vehicle) and (_x < (count _vehClose)))} do { + while{((!alive _vehicle) && (_x < (count _vehClose)))} do { _x = _x + 1; _vehicle = (_vehClose select _x); }; @@ -124,49 +124,49 @@ if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehi r_player_actions set [count r_player_actions,_action]; }; //Allow player to bandage - if(_injured and _hasBandage) then { + if(_injured && _hasBandage) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Epinephrine - if(_unconscious and _hasEpi) then { + if(_unconscious && _hasEpi) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Morphine - if((_legsBroke or _armsBroke) and _hasMorphine) then { + if((_legsBroke || _armsBroke) && _hasMorphine) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\morphine.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Painkillers - if(_inPain and _hasPainkillers) then { + if(_inPain && _hasPainkillers) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to transfuse blood - if(_lowBlood and _hasBlood) then { + if(_lowBlood && _hasBlood) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //Repairs - if ((_unit isKindOf "AllVehicles") and !(_unit isKindOf "Man") and !_isDisallowRefuel) then { + if ((_unit isKindOf "AllVehicles") && !(_unit isKindOf "Man") && !_isDisallowRefuel) then { _type = TypeOf(_unit); _typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); //CAN WE REFUEL THE OBJECT? - if ((fuel _unit < 1) and (_hasJerry or _hasBarrel)) then { + if ((fuel _unit < 1) && (_hasJerry || _hasBarrel)) then { r_action = true; _action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; }; //CAN WE siphon fuel from THE OBJECT? - if ((fuel _unit > 0) and (_hasJerryE or _hasBarrelE)) then { + if ((fuel _unit > 0) && (_hasJerryE || _hasBarrelE)) then { r_action = true; _action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[], 0, true, true, "", ""]; r_player_actions set [count r_player_actions,_action]; @@ -174,8 +174,8 @@ if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehi } else { - // should only fire if cursor target is man and not vehicle - if ((isPlayer _unit) and !(_charID in _friendlies)) then { + // should only fire if cursor target is man && not vehicle + if ((isPlayer _unit) && !(_charID in _friendlies)) then { r_action = true; _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""]; r_player_actions set [count r_player_actions,_action]; @@ -188,7 +188,7 @@ if (!isNull _menClose and _hasPatient and !r_drag_sqf and !r_action and !_inVehi }; /* -if ((r_player_vehicle != _vehicle) and r_action) then { +if ((r_player_vehicle != _vehicle) && r_action) then { //Player is in a new vehicle r_action = false; call fnc_usec_medic_removeActions; @@ -204,7 +204,7 @@ if (_inVehicle) then { if (_x getVariable "NORRN_unconscious") then { _unconscious_crew = _unconscious_crew + [_x] }; - } forEach _crew; + } count _crew; _patients = (count _unconscious_crew); if (_patients > 0) then { if (!r_action_unload) then { @@ -229,13 +229,13 @@ if (_inVehicle) then { }; //Remove Actions -if ((!_isClose or !_hasPatient) and r_action) then { +if ((!_isClose || !_hasPatient) && r_action) then { call fnc_usec_medic_removeActions; r_action = false; }; //Pain Effects -//if (r_player_inpain and !r_player_unconscious) then { +//if (r_player_inpain && !r_player_unconscious) then { // playSound "breath_1"; // addCamShake [2, 1, 25]; //}; diff --git a/SQF/dayz_code/compile/fn_damageHandler.sqf b/SQF/dayz_code/compile/fn_damageHandler.sqf index 7c631871e..0105fdc04 100644 --- a/SQF/dayz_code/compile/fn_damageHandler.sqf +++ b/SQF/dayz_code/compile/fn_damageHandler.sqf @@ -26,7 +26,7 @@ _unitIsPlayer = _unit == player; if (_unitIsPlayer) then { if (_hit == "") then { - if ((_source != player) and _isPlayer) then { + if ((_source != player) && _isPlayer) then { //Enable aggressor Actions if (_source isKindOf "CAManBase") then { _source setVariable["startcombattimer",1]; @@ -35,7 +35,7 @@ if (_unitIsPlayer) then { _isBandit = (player getVariable["humanity",0]) <= -5000; _isPZombie = player isKindOf "PZombie_VB"; - if (!_canHitFree and !_isBandit and !_isPZombie) then { + if (!_canHitFree && !_isBandit && !_isPZombie) then { //Process Morality Hit _myKills = 0 max (1 - (player getVariable ["humanKills",0]) / 5); _humanityHit = -100 * _myKills * _damage; @@ -64,7 +64,7 @@ if (_damage > 0.4) then { if (_isHeadHit) then { _scale = _scale + 500; }; - if ((isPlayer _source) and !(player == _source)) then { + if ((isPlayer _source) && !(player == _source)) then { _scale = _scale + 800; if (_isHeadHit) then { _scale = _scale + 500; @@ -126,7 +126,7 @@ if (_damage > 0.4) then { //0.25 _rndPain = (random 10); _rndInfection = (random 500); _hitPain = (_rndPain < _damage); - if ((_isHeadHit) or (_damage > 1.2 and _hitPain)) then { + if ((_isHeadHit) || (_damage > 1.2 && _hitPain)) then { _hitPain = true; }; _hitInfection = (_rndInfection < 1); @@ -139,7 +139,7 @@ if (_damage > 0.4) then { //0.25 }; if (_hitInfection) then { //Set Infection if not already - if (_unitIsPlayer and !_isPZombie) then { + if (_unitIsPlayer && !_isPZombie) then { r_player_infected = true; player setVariable["USEC_infected",true,true]; }; @@ -152,7 +152,7 @@ if (_damage > 0.4) then { //0.25 player setVariable["USEC_inPain",true,true]; }; }; - if ((_damage > 1.5) and _isHeadHit) then { + if ((_damage > 1.5) && _isHeadHit) then { [_source,"shothead"] spawn player_death; }; }; @@ -168,17 +168,17 @@ if (_damage > 0.4) then { //0.25 _inRange = _pos nearEntities ["CAManBase",1000]; { // only send to other players - if(isPlayer _x and _x != player) then { + if(isPlayer _x && _x != player) then { PVDZE_send = [_x,"Bleed",[_unit,_wound,_hit]]; publicVariableServer "PVDZE_send"; }; - } forEach _inRange; + } count _inRange; //Set Injured if not already _isInjured = _unit getVariable["USEC_injured",false]; if (!_isInjured) then { _unit setVariable["USEC_injured",true,true]; - if ((_unitIsPlayer) and (_ammo != "zombie")) then { + if ((_unitIsPlayer) && (_ammo != "zombie")) then { dayz_sourceBleeding = _source; }; }; @@ -197,7 +197,7 @@ if (_type == 1) then { /* BALISTIC DAMAGE */ - if ((_damage > 0.01) and (_unitIsPlayer)) then { + if ((_damage > 0.01) && (_unitIsPlayer)) then { //affect the player [20,45] call fnc_usec_pitchWhine; //Visual , Sound }; @@ -236,7 +236,7 @@ if (_type == 2) then { }; }; -if (!_unconscious and !_isMinor and ((_damage > 2) or ((_damage > 0.5) and _isHeadHit))) then { +if (!_unconscious && !_isMinor && ((_damage > 2) || ((_damage > 0.5) && _isHeadHit))) then { //set unconsious [_unit,_damage] call fnc_usec_damageUnconscious; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf index 6c72c0c73..6d983c12b 100644 --- a/SQF/dayz_code/compile/fn_damageHandlerZ.sqf +++ b/SQF/dayz_code/compile/fn_damageHandlerZ.sqf @@ -11,7 +11,7 @@ _projectile = _this select 4; if (local _zed) then { - if (_damage > 1 and _projectile != "") then { + if (_damage > 1 && _projectile != "") then { //Record deliberate critical damages switch (_selection) do { case "head_hit": { diff --git a/SQF/dayz_code/compile/fn_gearMenuChecks.sqf b/SQF/dayz_code/compile/fn_gearMenuChecks.sqf index 64bff6069..e0317e5b9 100644 --- a/SQF/dayz_code/compile/fn_gearMenuChecks.sqf +++ b/SQF/dayz_code/compile/fn_gearMenuChecks.sqf @@ -12,9 +12,9 @@ _isOk = false; if(!_isOk) then { _isOk = _cTarget isKindOf _x; }; -} forEach ["LandVehicle","Air", "Ship"]; +} count ["LandVehicle","Air", "Ship"]; -if((locked _cTarget) and _isOk and (((vehicle player) distance _cTarget) < 12)) then { +if((locked _cTarget) && _isOk && (((vehicle player) distance _cTarget) < 12)) then { cutText [(localize "str_epoch_player_7") , "PLAIN DOWN"]; _display closeDisplay 1; }; diff --git a/SQF/dayz_code/compile/fn_hasTools.sqf b/SQF/dayz_code/compile/fn_hasTools.sqf index f1a869803..05978b850 100644 --- a/SQF/dayz_code/compile/fn_hasTools.sqf +++ b/SQF/dayz_code/compile/fn_hasTools.sqf @@ -1,7 +1,7 @@ /* Description: -Checks whether the player has the required tools equipped or not -and displays a message if a tool is missing from the tool belt. +Checks whether the player has the required tools equipped || not +&& displays a message if a tool is missing from the tool belt. Parameter(s): _this: list of tool names the player is required to have @@ -22,5 +22,5 @@ _hasTools = true; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); cutText [format[(localize "STR_EPOCH_ACTIONS_13"), _missing] , "PLAIN DOWN"]; }; -} forEach _tools; +} count _tools; _hasTools diff --git a/SQF/dayz_code/compile/fn_inAngleSector.sqf b/SQF/dayz_code/compile/fn_inAngleSector.sqf index 1c4fb1033..a1474a3b7 100644 --- a/SQF/dayz_code/compile/fn_inAngleSector.sqf +++ b/SQF/dayz_code/compile/fn_inAngleSector.sqf @@ -6,7 +6,7 @@ // /* Returns true if lies within the sector defined by
, -
and . Use this function to determine if +
&& . Use this function to determine if a position lies within a certain angle from another position (ie the
). Example: [position player,getdir player,30,position enemy_tank] call BIS_fnc_inAngleSector diff --git a/SQF/dayz_code/compile/fn_isInsideBuilding.sqf b/SQF/dayz_code/compile/fn_isInsideBuilding.sqf index 409f8c7e9..4f2bfa92d 100644 --- a/SQF/dayz_code/compile/fn_isInsideBuilding.sqf +++ b/SQF/dayz_code/compile/fn_isInsideBuilding.sqf @@ -24,9 +24,9 @@ _myZ = _relPos select 2; //diag_log ("Y: " + str(_myY) ); //diag_log ("Z: " + str(_myZ) ); -if ((_myX > (_min select 0)) and (_myX < (_max select 0))) then { - if ((_myY > (_min select 1)) and (_myY < (_max select 1))) then { - if ((_myZ > (_min select 2)) and (_myZ < (_max select 2))) then { +if ((_myX > (_min select 0)) && (_myX < (_max select 0))) then { + if ((_myY > (_min select 1)) && (_myY < (_max select 1))) then { + if ((_myZ > (_min select 2)) && (_myZ < (_max select 2))) then { _inside = true; } else { _inside = false; }; } else { _inside = false; }; diff --git a/SQF/dayz_code/compile/fn_isInsideBuilding2.sqf b/SQF/dayz_code/compile/fn_isInsideBuilding2.sqf index 95ec829b0..5455a2061 100644 --- a/SQF/dayz_code/compile/fn_isInsideBuilding2.sqf +++ b/SQF/dayz_code/compile/fn_isInsideBuilding2.sqf @@ -23,9 +23,9 @@ _myZ = _relPos select 2; //diag_log ("Y: " + str(_myY) ); //diag_log ("Z: " + str(_myZ) ); -if ((_myX > (_min select 0)) and (_myX < (_max select 0))) then { - if ((_myY > (_min select 1)) and (_myY < (_max select 1))) then { - if ((_myZ > (_min select 2)) and (_myZ < (_max select 2))) then { +if ((_myX > (_min select 0)) && (_myX < (_max select 0))) then { + if ((_myY > (_min select 1)) && (_myY < (_max select 1))) then { + if ((_myZ > (_min select 2)) && (_myZ < (_max select 2))) then { _inside = true; } else { _inside = false; }; } else { _inside = false; }; diff --git a/SQF/dayz_code/compile/fn_isInsideBuilding3.sqf b/SQF/dayz_code/compile/fn_isInsideBuilding3.sqf index 12a99e07f..56c1738af 100644 --- a/SQF/dayz_code/compile/fn_isInsideBuilding3.sqf +++ b/SQF/dayz_code/compile/fn_isInsideBuilding3.sqf @@ -23,9 +23,9 @@ _myZ = _relPos select 2; //diag_log ("Y: " + str(_myY) ); //diag_log ("Z: " + str(_myZ) ); -if ((_myX > (_min select 0)) and (_myX < (_max select 0))) then { - if ((_myY > (_min select 1)) and (_myY < (_max select 1))) then { - if ((_myZ > (_min select 2)) and (_myZ < (_max select 2))) then { +if ((_myX > (_min select 0)) && (_myX < (_max select 0))) then { + if ((_myY > (_min select 1)) && (_myY < (_max select 1))) then { + if ((_myZ > (_min select 2)) && (_myZ < (_max select 2))) then { _inside = true; } else { _inside = false; }; } else { _inside = false; }; diff --git a/SQF/dayz_code/compile/fn_lightFunctions.sqf b/SQF/dayz_code/compile/fn_lightFunctions.sqf index 8021b84ff..08a34744a 100644 --- a/SQF/dayz_code/compile/fn_lightFunctions.sqf +++ b/SQF/dayz_code/compile/fn_lightFunctions.sqf @@ -23,7 +23,7 @@ _lights = ["a_fuelstation_sign.p3d","lampa_ind_zebr.p3d","lampa_ind.p3d","lampa_ }; }; }; - } foreach nearestObjects [([_target] call FNC_getPos), [], _rng]; + } count nearestObjects [([_target] call FNC_getPos), [], _rng]; }; @@ -101,7 +101,7 @@ _nrTLs= _twrPos nearObjects ["#lightpoint",20]; deleteVehicle _x; }; sleep .2; - }forEach _nrTLs; + }count _nrTLs; }else{ //axeDiagLog = format["FN:TL NEW LPS:%1",_twr]; diff --git a/SQF/dayz_code/compile/fn_removeItems.sqf b/SQF/dayz_code/compile/fn_removeItems.sqf index 83147b5d6..c75e2b546 100644 --- a/SQF/dayz_code/compile/fn_removeItems.sqf +++ b/SQF/dayz_code/compile/fn_removeItems.sqf @@ -1,10 +1,10 @@ /* Description: Removes the items (magazines) from the player's inventory -and performs a double check for the required items. +&& performs a double check for the required items. Parameter(s): -_this: list of item names to be removed (can also be an sub-array with item name and quantity) +_this: list of item names to be removed (can also be an sub-array with item name && quantity) Returns: Boolean (true if all items have been removed from the player's inventory) @@ -43,12 +43,12 @@ _tobe_removed_total = 0; _temp_removed_array set [count _temp_removed_array, _x]; }; }; - } forEach _inventory; + } count _inventory; }; -} forEach _items; +} count _items; // all parts removed if (_tobe_removed_total == _removed_total) exitWith { true }; // missing parts -{ player addMagazine _x; } forEach _temp_removed_array; +{ player addMagazine _x; } count _temp_removed_array; cutText [format[(localize "STR_EPOCH_ACTIONS_5"), _removed_total, _tobe_removed_total], "PLAIN DOWN"]; false diff --git a/SQF/dayz_code/compile/fn_selectRandomWeighted.sqf b/SQF/dayz_code/compile/fn_selectRandomWeighted.sqf index 6657e50cf..e345d726e 100644 --- a/SQF/dayz_code/compile/fn_selectRandomWeighted.sqf +++ b/SQF/dayz_code/compile/fn_selectRandomWeighted.sqf @@ -5,7 +5,7 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf"; Description: Function to select a random item from an array, taking into account item weights. - The weights should be Numbers between 0 and 1, with a maximum precision of hundreds. + The weights should be Numbers between 0 && 1, with a maximum precision of hundreds. Parameter(s): _this select 0: source Array (Array of Any Value) @@ -39,9 +39,9 @@ for "_i" from 0 to ((count _weights) - 1) do //If it's not, set weight to 0 to exclude it. if ((typeName _weight) != (typeName 0)) then {debugLog "Log: [selectRandomWeighted] Weights should be Numbers; weight set to 0!"; _weight = 0}; - //The weight should be a Number between 0 and 1. - if (_weight < 0) then {debugLog "Log: [selectRandomWeighted] Weights should be more than or equal to 0; weight set to 0!"; _weight = 0}; - //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than or equal to 1; weight set to 1!"; _weight = 1}; + //The weight should be a Number between 0 && 1. + if (_weight < 0) then {debugLog "Log: [selectRandomWeighted] Weights should be more than || equal to 0; weight set to 0!"; _weight = 0}; + //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than || equal to 1; weight set to 1!"; _weight = 1}; //Normalize the weight for a precision of hundreds. _weight = round(_weight * 100); @@ -52,7 +52,7 @@ for "_i" from 0 to ((count _weights) - 1) do }; }; -//Randomly select an index from the weighted array and therefore an element. +//Randomly select an index from the weighted array && therefore an element. private ["_index"]; _index = _weighted call BIS_fnc_selectRandom; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 02bdc5dc3..8117efc22 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -13,7 +13,7 @@ _isPZombie = player isKindOf "PZombie_VB"; _inVehicle = (_vehicle != player); _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); +_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); _nearLight = nearestObject [player,"LitObject"]; _canPickLight = false; @@ -24,7 +24,7 @@ if (!isNull _nearLight) then { }; //Grab Flare -if (_canPickLight and !dayz_hasLight and !_isPZombie) then { +if (_canPickLight && !dayz_hasLight && !_isPZombie) then { if (s_player_grabflare < 0) then { _text = getText (configFile >> "CfgAmmo" >> (typeOf _nearLight) >> "displayName"); s_player_grabflare = player addAction [format[localize "str_actions_medical_15",_text], "\z\addons\dayz_code\actions\flare_pickup.sqf",_nearLight, 1, false, true, "", ""]; @@ -39,7 +39,7 @@ if (_canPickLight and !dayz_hasLight and !_isPZombie) then { if (DZE_HeliLift) then { _hasAttached = _vehicle getVariable["hasAttached",false]; - if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) < 30) and (speed _vehicle < 5) and (typeName _hasAttached == "OBJECT")) then { + if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) < 30) && (speed _vehicle < 5) && (typeName _hasAttached == "OBJECT")) then { if (s_player_heli_detach < 0) then { dayz_myLiftVehicle = _vehicle; s_player_heli_detach = dayz_myLiftVehicle addAction ["Detach Vehicle","\z\addons\dayz_code\actions\player_heliDetach.sqf",[dayz_myLiftVehicle,_hasAttached],2,false,true,"",""]; @@ -51,7 +51,7 @@ if (DZE_HeliLift) then { }; if(DZE_HaloJump) then { - if(_inVehicle and (_vehicle isKindOf "Air") and ((([_vehicle] call FNC_getPos) select 2) > 400)) then { + if(_inVehicle && (_vehicle isKindOf "Air") && ((([_vehicle] call FNC_getPos) select 2) > 400)) then { if (s_halo_action < 0) then { DZE_myHaloVehicle = _vehicle; s_halo_action = DZE_myHaloVehicle addAction [localize "STR_EPOCH_ACTIONS_HALO","\z\addons\dayz_code\actions\halo_jump.sqf",[],2,false,true,"",""]; @@ -63,7 +63,7 @@ if(DZE_HaloJump) then { }; if (!DZE_ForceNameTagsOff) then { - if (s_player_showname < 0 and !_isPZombie) then { + if (s_player_showname < 0 && !_isPZombie) then { if (DZE_ForceNameTags) then { s_player_showname = 1; player setVariable["DZE_display_name",true,true]; @@ -85,13 +85,13 @@ if(_isPZombie) then { if (s_player_pzombiesvision < 0) then { s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"]; }; - if (!isNull cursorTarget and (player distance cursorTarget < 3)) then { //Has some kind of target + if (!isNull cursorTarget && (player distance cursorTarget < 3)) then { //Has some kind of target _isAnimal = cursorTarget isKindOf "Animal"; _isZombie = cursorTarget isKindOf "zZombie_base"; _isHarvested = cursorTarget getVariable["meatHarvested",false]; _isMan = cursorTarget isKindOf "Man"; - // Pzombie Gut human corpse or animal - if (!alive cursorTarget and (_isAnimal or _isMan) and !_isZombie and !_isHarvested) then { + // Pzombie Gut human corpse || animal + if (!alive cursorTarget && (_isAnimal || _isMan) && !_isZombie && !_isHarvested) then { if (s_player_pzombiesfeed < 0) then { s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",cursorTarget, 3, true, false, "",""]; }; @@ -105,15 +105,15 @@ if(_isPZombie) then { }; }; -// Increase distance only if AIR OR SHIP +// Increase distance only if AIR || SHIP _allowedDistance = 4; _isAir = cursorTarget isKindOf "Air"; _isShip = cursorTarget isKindOf "Ship"; -if(_isAir or _isShip) then { +if(_isAir || _isShip) then { _allowedDistance = 8; }; -if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cursorTarget < _allowedDistance) and _canDo) then { //Has some kind of target +if (!isNull cursorTarget && !_inVehicle && !_isPZombie && (player distance cursorTarget < _allowedDistance) && _canDo) then { //Has some kind of target // set cursortarget to variable _cursorTarget = cursorTarget; @@ -127,7 +127,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; _isnewstorage = _typeOfCursorTarget in DZE_isNewStorage; - // get items and magazines only once + // get items && magazines only once _magazinesPlayer = magazines player; //boiled Water @@ -137,7 +137,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if (_x in _magazinesPlayer) then { _hastinitem = true; }; - } forEach boil_tin_cans; + } count boil_tin_cans; _hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer; _hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer; _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer; @@ -155,7 +155,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _temp_keys_names set [_ownerKeyId,_ownerKeyName]; _temp_keys set [count _temp_keys,str(_ownerKeyId)]; }; - } forEach _itemsPlayer; + } count _itemsPlayer; _hasKnife = "ItemKnife" in _itemsPlayer; _hasToolbox = "ItemToolbox" in _itemsPlayer; @@ -187,13 +187,13 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if (_x in _magazinesPlayer) then { _hasRawMeat = true; }; - } forEach _rawmeat; + } count _rawmeat; _isFuel = false; - if (_hasFuelE or _hasFuelBarrelE) then { + if (_hasFuelE || _hasFuelBarrelE) then { { if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;}; - } forEach dayz_fuelsources; + } count dayz_fuelsources; }; // diag_log ("OWNERID = " + _ownerID + " CHARID = " + dayz_characterID + " " + str(_ownerID == dayz_characterID)); @@ -219,37 +219,37 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if(_isAlive) then { //Allow player to delete objects - if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding) then { - if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then { + if(_isDestructable || _isWreck || _isRemovable || _isWreckBuilding) then { + if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then { _player_deleteBuild = true; }; }; //Allow owners to delete modulars - if(_isModular and (dayz_characterID == _ownerID)) then { - if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then { + if(_isModular && (dayz_characterID == _ownerID)) then { + if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then { _player_deleteBuild = true; }; }; //Allow owners to delete modular doors without locks - if(_isModularDoor and (dayz_characterID == _ownerID)) then { - if(_hasToolbox and "ItemCrowbar" in _itemsPlayer) then { + if(_isModularDoor && (dayz_characterID == _ownerID)) then { + if(_hasToolbox && "ItemCrowbar" in _itemsPlayer) then { _player_deleteBuild = true; }; }; // CURSOR TARGET VEHICLE if(_isVehicle) then { - //flip vehicle small vehicles by your self and all other vehicles with help nearby - if (!(canmove _cursorTarget) and (player distance _cursorTarget >= 2) and (count (crew _cursorTarget))== 0 and ((vectorUp _cursorTarget) select 2) < 0.5) then { + //flip vehicle small vehicles by your self && all other vehicles with help nearby + if (!(canmove _cursorTarget) && (player distance _cursorTarget >= 2) && (count (crew _cursorTarget))== 0 && ((vectorUp _cursorTarget) select 2) < 0.5) then { _playersNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]); - if(_isVehicletype or (_playersNear >= 2)) then { + if(_isVehicletype || (_playersNear >= 2)) then { _player_flipveh = true; }; }; - if(!_isMan and _ownerID != "0" and !(_cursorTarget isKindOf "Bicycle")) then { + if(!_isMan && _ownerID != "0" && !(_cursorTarget isKindOf "Bicycle")) then { _player_lockUnlock_crtl = true; }; @@ -276,7 +276,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if(!_allowTow) then { _allowTow = _cursorTarget isKindOf _x; }; - } forEach DZE_HeliAllowToTow; + } count DZE_HeliAllowToTow; }; //diag_log format["CREW: %1 ALLOW: %2",(count (crew _cursorTarget)),_allowTow]; @@ -289,20 +289,20 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _posC = [_cursorTarget] call FNC_getPos; _height = (_posL select 2) - (_posC select 2); _hasAttached = _x getVariable["hasAttached",false]; - if(_height < 15 and _height > 5 and (typeName _hasAttached != "OBJECT")) then { - if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then { + if(_height < 15 && _height > 5 && (typeName _hasAttached != "OBJECT")) then { + if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then { _liftHeli = _x; _found = true; }; }; }; - } forEach _liftHelis; + } count _liftHelis; }; //diag_log format["HELI: %1 TARGET: %2",_found,_cursorTarget]; _attached = _cursorTarget getVariable["attached",false]; - if(_found and _allowTow and _canDo and !locked _cursorTarget and !_isPZombie and (typeName _attached != "OBJECT")) then { + if(_found && _allowTow && _canDo && !locked _cursorTarget && !_isPZombie && (typeName _attached != "OBJECT")) then { if (s_player_heli_lift < 0) then { s_player_heli_lift = player addAction ["Attach to Heli", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true, "",""]; }; @@ -312,13 +312,13 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; }; - // Allow Owner to lock and unlock vehicle + // Allow Owner to lock && unlock vehicle if(_player_lockUnlock_crtl) then { if (s_player_lockUnlock_crtl < 0) then { _hasKey = _ownerID in _temp_keys; _oldOwner = (_ownerID == dayz_playerUID); if(locked _cursorTarget) then { - if(_hasKey or _oldOwner) then { + if(_hasKey || _oldOwner) then { _Unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (parseNumber _ownerID))], 2, true, true, "", ""]; s_player_lockunlock set [count s_player_lockunlock,_Unlock]; s_player_lockUnlock_crtl = 1; @@ -332,7 +332,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu s_player_lockUnlock_crtl = 1; }; } else { - if(_hasKey or _oldOwner) then { + if(_hasKey || _oldOwner) then { _lock = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\lock_veh.sqf",_cursorTarget, 1, true, true, "", ""]; s_player_lockunlock set [count s_player_lockunlock,_lock]; s_player_lockUnlock_crtl = 1; @@ -341,13 +341,13 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; } else { - {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; + {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = []; s_player_lockUnlock_crtl = -1; }; if(DZE_AllowForceSave) then { //Allow player to force save - if((_isVehicle or _isTent) and !_isMan) then { + if((_isVehicle || _isTent) && !_isMan) then { if (s_player_forceSave < 0) then { s_player_forceSave = player addAction [format[localize "str_actions_save",_text], "\z\addons\dayz_code\actions\forcesave.sqf",_cursorTarget, 1, true, true, "", ""]; }; @@ -360,7 +360,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu If(DZE_AllowCargoCheck) then { - if((_isVehicle or _isTent or _isnewstorage) and _isAlive and !_isMan and !locked _cursorTarget) then { + if((_isVehicle || _isTent || _isnewstorage) && _isAlive && !_isMan && !locked _cursorTarget) then { if (s_player_checkGear < 0) then { s_player_checkGear = player addAction [localize "STR_EPOCH_PLAYER_CARGO", "\z\addons\dayz_code\actions\cargocheck.sqf",_cursorTarget, 1, true, true, "", ""]; }; @@ -371,7 +371,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; - //flip vehicle small vehicles by your self and all other vehicles with help nearby + //flip vehicle small vehicles by your self && all other vehicles with help nearby if(_player_flipveh) then { if (s_player_flipveh < 0) then { s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true, "", ""]; @@ -382,7 +382,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; //Allow player to fill jerrycan - if((_hasFuelE or _hasFuelBarrelE) and _isFuel) then { + if((_hasFuelE || _hasFuelBarrelE) && _isFuel) then { if (s_player_fillfuel < 0) then { s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""]; }; @@ -400,7 +400,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if (!_isAlive) then { // Gut animal/zed - if((_isAnimal or _isZombie) and _hasKnife) then { + if((_isAnimal || _isZombie) && _hasKnife) then { _isHarvested = _cursorTarget getVariable["meatHarvested",false]; if (!_isHarvested) then { _player_butcher = true; @@ -408,14 +408,14 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; // Study body - if (_isMan and !_isZombie and !_isAnimal) then { + if (_isMan && !_isZombie && !_isAnimal) then { _player_studybody = true; } } else { // unit alive // gear access on surrendered player - if(_isMan and !_isZombie and !_isAnimal) then { + if(_isMan && !_isZombie && !_isAnimal) then { _isSurrendered = _cursorTarget getVariable ["DZE_Surrendered",false]; if (_isSurrendered) then { _player_SurrenderedGear = true; @@ -424,7 +424,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; - // Human Gut animal or zombie + // Human Gut animal || zombie if (_player_butcher) then { if (s_player_butcher < 0) then { if(_isZombie) then { @@ -461,7 +461,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; // Boil water - if (_hasbottleitem and _hastinitem) then { + if (_hasbottleitem && _hastinitem) then { _player_boil = true; }; }; @@ -496,7 +496,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; if(_cursorTarget == dayz_hasFire) then { - if ((s_player_fireout < 0) and !(inflamed _cursorTarget) and (player distance _cursorTarget < 3)) then { + if ((s_player_fireout < 0) && !(inflamed _cursorTarget) && (player distance _cursorTarget < 3)) then { s_player_fireout = player addAction [localize "str_actions_self_06", "\z\addons\dayz_code\actions\fire_pack.sqf",_cursorTarget, 0, false, true, "",""]; }; } else { @@ -505,13 +505,13 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; //Packing my tent - if(_isTent and (player distance _cursorTarget < 3)) then { + if(_isTent && (player distance _cursorTarget < 3)) then { if (_ownerID == dayz_characterID) then { if (s_player_packtent < 0) then { s_player_packtent = player addAction [localize "str_actions_self_07", "\z\addons\dayz_code\actions\tent_pack.sqf",_cursorTarget, 0, false, true, "",""]; }; } else { - if(("ItemJerrycan" in _magazinesPlayer) and ("ItemMatchbox_DZE" in weapons player)) then { + if(("ItemJerrycan" in _magazinesPlayer) && ("ItemMatchbox_DZE" in weapons player)) then { if (s_player_packtent < 0) then { s_player_packtent = player addAction [localize "STR_EPOCH_ACTIONS_DESTROYTENT", "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""]; }; @@ -523,10 +523,10 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; //Allow owner to unlock vault - if((_typeOfCursorTarget in DZE_LockableStorage) and _ownerID != "0" and (player distance _cursorTarget < 3)) then { + if((_typeOfCursorTarget in DZE_LockableStorage) && _ownerID != "0" && (player distance _cursorTarget < 3)) then { if (s_player_unlockvault < 0) then { if(_typeOfCursorTarget in DZE_LockedStorage) then { - if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then { + if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then { _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true, "",""]; s_player_combi set [count s_player_combi,_combi]; } else { @@ -535,7 +535,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; s_player_unlockvault = 1; } else { - if(_ownerID != dayz_combination and _ownerID != dayz_playerUID) then { + if(_ownerID != dayz_combination && _ownerID != dayz_playerUID) then { _combi = player addAction [localize "STR_EPOCH_ACTIONS_RECOMBO", "\z\addons\dayz_code\actions\vault_combination_1.sqf",_cursorTarget, 0, false, true, "",""]; s_player_combi set [count s_player_combi,_combi]; s_player_unlockvault = 1; @@ -543,19 +543,19 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; }; } else { - {player removeAction _x} forEach s_player_combi;s_player_combi = []; + {player removeAction _x} count s_player_combi;s_player_combi = []; s_player_unlockvault = -1; }; //Allow owner to pack vault - if(_typeOfCursorTarget in DZE_UnLockedStorage and _ownerID != "0" and (player distance _cursorTarget < 3)) then { + if(_typeOfCursorTarget in DZE_UnLockedStorage && _ownerID != "0" && (player distance _cursorTarget < 3)) then { if (s_player_lockvault < 0) then { - if(_ownerID == dayz_combination or _ownerID == dayz_playerUID) then { + if(_ownerID == dayz_combination || _ownerID == dayz_playerUID) then { s_player_lockvault = player addAction [format[localize "STR_EPOCH_ACTIONS_LOCK",_text], "\z\addons\dayz_code\actions\vault_lock.sqf",_cursorTarget, 0, false, true, "",""]; }; }; - if (s_player_packvault < 0 and (_ownerID == dayz_combination or _ownerID == dayz_playerUID)) then { + if (s_player_packvault < 0 && (_ownerID == dayz_combination || _ownerID == dayz_playerUID)) then { s_player_packvault = player addAction [format["%1",(format[localize "STR_EPOCH_ACTIONS_PACK",_text])], "\z\addons\dayz_code\actions\vault_pack.sqf",_cursorTarget, 0, false, true, "",""]; }; } else { @@ -585,10 +585,10 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _findNearestGens = nearestObjects [player, ["Generator_DZ"], 30]; _findNearestGen = []; { - if (alive _x and (_x getVariable ["GeneratorRunning", false])) then { + if (alive _x && (_x getVariable ["GeneratorRunning", false])) then { _findNearestGen set [(count _findNearestGen),_x]; }; - } foreach _findNearestGens; + } count _findNearestGens; _IsNearRunningGen = count (_findNearestGen); // show that pump needs power if no generator nearby. @@ -604,7 +604,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; //Fuel Pump on truck - if(_typeOfCursorTarget in DZE_fueltruckarray and alive _cursorTarget) then { + if(_typeOfCursorTarget in DZE_fueltruckarray && alive _cursorTarget) then { if (s_player_fuelauto2 < 0) then { // show that fuel truck pump needs power. if(isEngineOn _cursorTarget) then { @@ -619,7 +619,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; // inplace upgrade tool - if ((_cursorTarget isKindOf "ModularItems") or (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") or (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then { + if ((_cursorTarget isKindOf "ModularItems") || (_cursorTarget isKindOf "Land_DZE_WoodDoor_Base") || (_cursorTarget isKindOf "CinderWallDoor_DZ_Base")) then { if ((s_player_lastTarget select 0) != _cursorTarget) then { if (s_player_upgrade_build > 0) then { player removeAction s_player_upgrade_build; @@ -637,7 +637,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; // downgrade system - if((_isDestructable or _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" or _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") and (DZE_Lock_Door == _ownerID)) then { + if((_isDestructable || _cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" || _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") && (DZE_Lock_Door == _ownerID)) then { if ((s_player_lastTarget select 1) != _cursorTarget) then { if (s_player_downgrade_build > 0) then { player removeAction s_player_downgrade_build; @@ -655,7 +655,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; // inplace maintenance tool - if((_cursorTarget isKindOf "ModularItems" or _cursorTarget isKindOf "DZE_Housebase" or _typeOfCursorTarget == "LightPole_DZ") and (damage _cursorTarget >= DZE_DamageBeforeMaint)) then { + if((_cursorTarget isKindOf "ModularItems" || _cursorTarget isKindOf "DZE_Housebase" || _typeOfCursorTarget == "LightPole_DZ") && (damage _cursorTarget >= DZE_DamageBeforeMaint)) then { if ((s_player_lastTarget select 2) != _cursorTarget) then { if (s_player_maint_build > 0) then { player removeAction s_player_maint_build; @@ -681,7 +681,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if((_cursorTarget getVariable ["GeneratorRunning", false])) then { s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR1", "\z\addons\dayz_code\actions\stopGenerator.sqf",_cursorTarget, 0, false, true, "",""]; } else { - // check if not filled and player has jerry. + // check if not filled && player has jerry. if((_cursorTarget getVariable ["GeneratorFilled", false])) then { s_player_fillgen = player addAction [localize "STR_EPOCH_ACTIONS_GENERATOR2", "\z\addons\dayz_code\actions\fill_startGenerator.sqf",_cursorTarget, 0, false, true, "",""]; } else { @@ -714,8 +714,8 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu //Sleep - if(_isTent and _ownerID == dayz_characterID) then { - if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then { + if(_isTent && _ownerID == dayz_characterID) then { + if ((s_player_sleep < 0) && (player distance _cursorTarget < 3)) then { s_player_sleep = player addAction [localize "str_actions_self_sleep", "\z\addons\dayz_code\actions\player_sleep.sqf",_cursorTarget, 0, false, true, "",""]; }; } else { @@ -724,7 +724,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; //Repairing Vehicles - if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then { + if ((dayz_myCursorTarget != _cursorTarget) && _isVehicle && !_isMan && _hasToolbox && (damage _cursorTarget < 1) && !_isDisallowRepair) then { if (s_player_repair_crtl < 0) then { dayz_myCursorTarget = _cursorTarget; _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""]; @@ -733,13 +733,13 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu s_player_repairActions set [count s_player_repairActions,_menu1]; s_player_repair_crtl = 1; } else { - {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; + {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; s_player_repair_crtl = -1; }; }; // All Traders - if (_isMan and !_isPZombie and _traderType in serverTraders) then { + if (_isMan && !_isPZombie && _traderType in serverTraders) then { if (s_player_parts_crtl < 0) then { @@ -772,7 +772,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu _buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""]; s_player_parts set [count s_player_parts,_buy]; - } forEach (_traderMenu select 1); + } count (_traderMenu select 1); // Database menu _buy = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\show_dialog.sqf",(_traderMenu select 0), 999, true, false, "",""]; s_player_parts set [count s_player_parts,_buy]; @@ -782,7 +782,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu }; } else { - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; }; @@ -790,7 +790,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu if(dayz_tameDogs) then { //Dog - if (_isDog and _isAlive and (_hasRawMeat) and _ownerID == "0" and player getVariable ["dogID", 0] == 0) then { + if (_isDog && _isAlive && (_hasRawMeat) && _ownerID == "0" && player getVariable ["dogID", 0] == 0) then { if (s_player_tamedog < 0) then { s_player_tamedog = player addAction [localize "str_actions_tamedog", "\z\addons\dayz_code\actions\tame_dog.sqf", _cursorTarget, 1, false, true, "", ""]; }; @@ -798,12 +798,12 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu player removeAction s_player_tamedog; s_player_tamedog = -1; }; - if (_isDog and _ownerID == dayz_characterID and _isAlive) then { + if (_isDog && _ownerID == dayz_characterID && _isAlive) then { _dogHandle = player getVariable ["dogID", 0]; - if (s_player_feeddog < 0 and _hasRawMeat) then { + if (s_player_feeddog < 0 && _hasRawMeat) then { s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true,"",""]; }; - if (s_player_waterdog < 0 and "ItemWaterbottle" in _magazinesPlayer) then { + if (s_player_waterdog < 0 && "ItemWaterbottle" in _magazinesPlayer) then { s_player_waterdog = player addAction [localize "str_actions_waterdog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,1], 0, false, true,"",""]; }; if (s_player_staydog < 0) then { @@ -845,18 +845,18 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu } else { //Engineering - {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = []; + {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; s_player_repair_crtl = -1; - {player removeAction _x} forEach s_player_combi;s_player_combi = []; + {player removeAction _x} count s_player_combi;s_player_combi = []; dayz_myCursorTarget = objNull; s_player_lastTarget = [objNull,objNull,objNull,objNull,objNull]; - {player removeAction _x} forEach s_player_parts;s_player_parts = []; + {player removeAction _x} count s_player_parts;s_player_parts = []; s_player_parts_crtl = -1; - {player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = []; + {player removeAction _x} count s_player_lockunlock;s_player_lockunlock = []; s_player_lockUnlock_crtl = -1; player removeAction s_player_checkGear; @@ -940,7 +940,7 @@ if (_dogHandle > 0) then { _dog = _dogHandle getFSMVariable "_dog"; _ownerID = "0"; if (!isNull cursorTarget) then { _ownerID = cursorTarget getVariable ["CharacterID","0"]; }; - if (_canDo and !_inVehicle and alive _dog and _ownerID != dayz_characterID) then { + if (_canDo && !_inVehicle && alive _dog && _ownerID != dayz_characterID) then { if (s_player_movedog < 0) then { s_player_movedog = player addAction [localize "str_actions_movedog", "\z\addons\dayz_code\actions\dog\move.sqf", player getVariable ["dogID", 0], 1, false, true, "", ""]; }; diff --git a/SQF/dayz_code/compile/fn_setpitchbank.sqf b/SQF/dayz_code/compile/fn_setpitchbank.sqf index e4cd65eaa..e4d61f028 100644 --- a/SQF/dayz_code/compile/fn_setpitchbank.sqf +++ b/SQF/dayz_code/compile/fn_setpitchbank.sqf @@ -1,18 +1,18 @@ /************************************************************ -Set Pitch and Bank -By General Barron ([EMAIL=aw_barron@hotmail.com]aw_barron@hotmail.com[/EMAIL]) and vektorboson +Set Pitch && Bank +By General Barron ([EMAIL=aw_barron@hotmail.com]aw_barron@hotmail.com[/EMAIL]) && vektorboson Parameters: [object, pitch, bank] Returns: nothing -Rotates an object, giving it the specified pitch and bank, +Rotates an object, giving it the specified pitch && bank, in degrees. Pitch is 0 when the object is level; 90 when pointing straight -up; and -90 when pointing straight down. +up; && -90 when pointing straight down. Bank is 0 when level; 90 when the object is rolled to the right, --90 when rolled to the left, and 180 when rolled upside down. +-90 when rolled to the left, && 180 when rolled upside down. Note that the object's yaw can be set with the setdir command, which should be issued before using this function, if required. @@ -83,7 +83,7 @@ _yaw = 360-(getdir _obj); //use bank to flip upside down _bank = _bank + 180; -//and adjust our original pitch +//&& adjust our original pitch _pitch = (180 - abs _pitch)*_sign; }; diff --git a/SQF/dayz_code/compile/fn_temperatur.sqf b/SQF/dayz_code/compile/fn_temperatur.sqf index 2ffb9290f..300e29bce 100644 --- a/SQF/dayz_code/compile/fn_temperatur.sqf +++ b/SQF/dayz_code/compile/fn_temperatur.sqf @@ -27,7 +27,7 @@ Missing: //All Values can be seen as x of 100: 100 / x = minutes from min temperetaure to max temperature (without other effects) _vehicle_factor = 4; _moving_factor = 7; - _fire_factor = 15; //Should be always: _rain_factor + _night_factor + _wind_factor OR higher ! + _fire_factor = 15; //Should be always: _rain_factor + _night_factor + _wind_factor || higher ! _building_factor = 7; _sun_factor = 4; //max sunfactor linear over the day. highest value in the middle of the day @@ -72,7 +72,7 @@ Missing: _building = nearestObject [player, "HouseBase"]; if(!isNull _building) then { if([player,_building] call fnc_isInsideBuilding) then { - //Make sure thate Fire and Building Effect can only appear single Not used at the moment + //Make sure thate Fire && Building Effect can only appear single Not used at the moment //if(!_hasfireffect && _fire_factor > _building_factor) then { _difference = _difference + _building_factor; //}; @@ -106,7 +106,7 @@ Missing: t = -(f / (12 - s)�) * (d - 12)� + f Parabel with highest Point( greatest Effect == _sun_factor) always at 12.00 - Zero Points are always at sunrise and sunset -> Only Positiv Values Possible + Zero Points are always at sunrise && sunset -> Only Positiv Values Possible */ _difference = _difference + (-((_sun_factor / (12 - _sunrise)^2)) * ((daytime - 12)^2) + _sun_factor); diff --git a/SQF/dayz_code/compile/fn_unconscious.sqf b/SQF/dayz_code/compile/fn_unconscious.sqf index 222479c67..c9d4bca4d 100644 --- a/SQF/dayz_code/compile/fn_unconscious.sqf +++ b/SQF/dayz_code/compile/fn_unconscious.sqf @@ -1,6 +1,6 @@ private ["_nul","_timeout","_isOnDeck","_isInLocation","_inVehicle","_bloodLow","_isHospital","_totalTimeout","_display","_ctrl1","_ctrl1Pos"]; disableSerialization; -if ((!r_player_handler1) and (r_handlerCount == 0)) then { +if ((!r_player_handler1) && (r_handlerCount == 0)) then { //Unconscious Meter _totalTimeout = r_player_timeout; if (_totalTimeout == 0) then { _totalTimeout = 1; }; //Fix for zero divisor @@ -29,12 +29,12 @@ if ((!r_player_handler1) and (r_handlerCount == 0)) then { _isInLocation = false; //getPos player in LHA_Location; _inVehicle = (vehicle player != player); _bloodLow = ((r_player_blood/r_player_bloodTotal) < 0.5); - if ((surfaceIsWater (getPosASL player)) and !_isOnDeck and !_inVehicle) then { + if ((surfaceIsWater (getPosASL player)) && !_isOnDeck && !_inVehicle) then { player setpos [(getPosASL player select 0),(getPosASL player select 1),0.3]; }; if(_timeout == 0) then { - if (!r_player_dead and !_bloodLow and r_player_injured) then { + if (!r_player_dead && !_bloodLow && r_player_injured) then { _timeout = 10; //_animType = (USEC_WoundAnim select (floor(random (count USEC_WoundAnim)))); //player playActionNow _anim; @@ -46,13 +46,13 @@ if ((!r_player_handler1) and (r_handlerCount == 0)) then { if (r_player_timeout > 0) then { r_player_timeout = r_player_timeout - 1; } else { - if ((!r_player_dead) and (!r_player_cardiac)) then { + if ((!r_player_dead) && (!r_player_cardiac)) then { _nul = [] spawn fnc_usec_recoverUncons; }; }; //Check if near field hospital _isHospital = false; //(count( nearestObjects [player, ["USMC_WarfareBFieldhHospital"], 8]) > 0); - if (_isHospital or _isOnDeck or _isInLocation) then { + if (_isHospital || _isOnDeck || _isInLocation) then { waitUntil {!(player getVariable ["NORRN_unit_dragged", false])}; @@ -87,7 +87,7 @@ if ((!r_player_handler1) and (r_handlerCount == 0)) then { player setVariable ["USEC_inPain", false, true]; player setdamage 0; - {player setVariable[_x,false,true];} forEach USEC_woundHit; + {player setVariable[_x,false,true];} count USEC_woundHit; player setVariable ["USEC_injured",false,true]; sleep 1; @@ -106,7 +106,7 @@ if ((!r_player_handler1) and (r_handlerCount == 0)) then { disableUserInput false; //waitUntil{USEC_MotherInbox == ""}; //["MED001",0,"Conscious"] call fnc_usec_recordEventClient; - if (!r_player_injured and ((r_player_blood/r_player_bloodTotal) >= 0.5)) then { + if (!r_player_injured && ((r_player_blood/r_player_bloodTotal) >= 0.5)) then { 10 fadeSound 1; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5; diff --git a/SQF/dayz_code/compile/local_gutObject.sqf b/SQF/dayz_code/compile/local_gutObject.sqf index 992f40b15..8299b12d6 100644 --- a/SQF/dayz_code/compile/local_gutObject.sqf +++ b/SQF/dayz_code/compile/local_gutObject.sqf @@ -14,7 +14,7 @@ if (local _animalbody) then { _timer = _this select 0; _body = _this select 1; _pos = getPosATL _body; - while {(count magazines _body >0) and (time - _timer < 300) } do { + while {(count magazines _body >0) && (time - _timer < 300) } do { sleep 5; }; @@ -24,11 +24,11 @@ if (local _animalbody) then { _inRange = _pos nearEntities ["CAManBase",100]; { // only send to other players - if(isPlayer _x and _x != player) then { + if(isPlayer _x && _x != player) then { PVDZE_send = [_x,"HideBody",[_body]]; publicVariableServer "PVDZE_send"; }; - } forEach _inRange; + } count _inRange; sleep 5; deleteVehicle _body; diff --git a/SQF/dayz_code/compile/local_gutObjectZ.sqf b/SQF/dayz_code/compile/local_gutObjectZ.sqf index dc48a5a39..b15132983 100644 --- a/SQF/dayz_code/compile/local_gutObjectZ.sqf +++ b/SQF/dayz_code/compile/local_gutObjectZ.sqf @@ -10,7 +10,7 @@ if (local _zombiebody) then { _timer = _this select 0; _body = _this select 1; _pos = getPosATL _body; - while {(count magazines _body >0) and (time - _timer < 300) } do { + while {(count magazines _body >0) && (time - _timer < 300) } do { sleep 5; }; @@ -19,11 +19,11 @@ if (local _zombiebody) then { /* PVS/PVC - Skaronator */ _inRange = _pos nearEntities ["CAManBase",100]; { - if(isPlayer _x and _x != player) then { + if(isPlayer _x && _x != player) then { PVDZE_send = [_x,"HideBody",[_body]]; publicVariableServer "PVDZE_send"; }; - } forEach _inRange; + } count _inRange; sleep 5; deleteVehicle _body; diff --git a/SQF/dayz_code/compile/local_lights_house.sqf b/SQF/dayz_code/compile/local_lights_house.sqf index e63bd89e3..30fd51648 100644 --- a/SQF/dayz_code/compile/local_lights_house.sqf +++ b/SQF/dayz_code/compile/local_lights_house.sqf @@ -63,7 +63,7 @@ if(!isNil "_objHouse")then{ _validHouses = _validHouses +1; }; - } forEach _objHouse; + } count _objHouse; _maxHouses = ((_validHouses/100)*_lightPcnt); @@ -77,7 +77,7 @@ if(!isNil "_objHouse")then{ if(_currLighting < _maxHouses)then{ - if(_lightPcnt > floor (random 100))then{//Randomness required or first nearest houses to player get lit in a block - Needs to be based on range ! + if(_lightPcnt > floor (random 100))then{//Randomness required || first nearest houses to player get lit in a block - Needs to be based on range ! //axeDiagLog = format["HL:Lighting New House: %3 Num:%1 Type: %4 for %2 | Dist:%5",_currLighting, name player,_x,typeOf _x,player distance _x]; //publicVariable "axeDiagLog"; @@ -114,7 +114,7 @@ if(!isNil "_objHouse")then{ }; }; - }forEach _notLitHouses; + }count _notLitHouses; }else{ //axeDiagLog = format["House Limit Reached(%3): Max:%1 | Count:%2",_maxHouses,count _litHouses,name player]; @@ -127,7 +127,7 @@ if(!isNil "_objHouse")then{ _pos = [_x] call FNC_getPos; if((abs ([_pos, _objLightPoint] call BIS_fnc_distance2D))<_hsLPDist)then{//In House - if(_plyr distance _x < _lpRange)then{//If within range and outside band + if(_plyr distance _x < _lpRange)then{//If within range && outside band _brtns = [_plyr,_x] call axe_lightBrightness; _objLightPoint enableSimulation false;//Attempt to stop Arma from broadcasting lightpoint, just reminding it here ! DO NOT USE ! Will stop light from being visible to player (At least upon creation) ! _objLightPoint setLightColor _lmpCol; @@ -153,7 +153,7 @@ if(!isNil "_objHouse")then{ }; }; - }forEach _litHouses; + }count _litHouses; }; }else{ diff --git a/SQF/dayz_code/compile/local_lights_init.sqf b/SQF/dayz_code/compile/local_lights_init.sqf index 56e12c9df..53e3a263f 100644 --- a/SQF/dayz_code/compile/local_lights_init.sqf +++ b/SQF/dayz_code/compile/local_lights_init.sqf @@ -23,7 +23,7 @@ if(!isDedicated)then{ _nrGen = []; _genCount = 0; _hsRange = 250;//set var - _houseNum = 0;//Monitor house numbers in range.. Pass around and reduce range if too many and/or client lag (NOT server / client lag) + _houseNum = 0;//Monitor house numbers in range.. Pass around && reduce range if too many &&/|| client lag (NOT server / client lag) _lightTrig = vehicle player;//Central point around which to run the lights _plyPos = [0,0,0]; call compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_lightFunctions.sqf"; @@ -32,7 +32,7 @@ if(!isDedicated)then{ waitUntil {(([Player] call FNC_getPos) select 0) > 0}; - //Detect Dusk and Dawn + //Detect Dusk && Dawn _sunrise = call world_sunRise; _fnHr = _sunrise + 0.5; _stHr = (24 - _sunrise) - 0.5; @@ -50,14 +50,14 @@ if(!isDedicated)then{ _nrGen = nearestObjects [_plyr, [_genClass], _rngPlyr]; _genCount = count _nrGen; - //Set Generator to use and Assign trigger object + //Set Generator to use && Assign trigger object if(_genCount>0)then{ { if(_x getVariable["GeneratorRunning",false])exitWith{ _lightTrig = _x; }; - }forEach _nrGen; + }count _nrGen; }; }; @@ -69,7 +69,7 @@ if(!isDedicated)then{ //Generator not required ! if(!_ndGen)then{_doLight = true;}; - //Choose range, player or generator + //Choose range, player || generator if(_ndGen)then{_hsRange = _trgRng;}else{_hsRange = _rngPlyr;}; //100% chance of lights with nearby generator - ToDo, make this slightly lower. @@ -116,7 +116,7 @@ if(isServer)then{ DZE_DYN_cleanLightpoints = true; _missonLights = entities "#lightpoint"; _missionObjs = allMissionObjects "#lightpoint"; - diag_log (format["CLEANUP: Attempting Cleanup of Lights out of %1 or %2",count _missonLights, count _missionObjs]); + diag_log (format["CLEANUP: Attempting Cleanup of Lights out of %1 || %2",count _missonLights, count _missionObjs]); _delQtyLights = 0; { if (local _x) then { @@ -127,7 +127,7 @@ if(isServer)then{ if (!alive _x) then { _pos = getPosATL _x; if (count _pos > 0) then { - _nearby = {(isPlayer _x) and (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 420]);//Use calculated range here. + _nearby = {(isPlayer _x) && (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 420]);//Use calculated range here. if (_nearby==0) then { _x call dayz_perform_purge; sleep 0.025; @@ -137,7 +137,7 @@ if(isServer)then{ }; }; sleep 0.001; - } forEach _missonLights; + } count _missonLights; if (_delQtyLights > 0) then { _qty = count _missonLights; diag_log (format["CLEANUP: Deleted %1 Lights out of %2",_delQtyLights,_qty]); diff --git a/SQF/dayz_code/compile/local_lights_off.sqf b/SQF/dayz_code/compile/local_lights_off.sqf index 43ac03af3..bdcbdd187 100644 --- a/SQF/dayz_code/compile/local_lights_off.sqf +++ b/SQF/dayz_code/compile/local_lights_off.sqf @@ -1,6 +1,6 @@ /* DayZ Epoch Lighting System - Lights Out - Made for DayZ Epoch by axeman please ask permission to use/edit/distribute email gregory.andrew@gmail.com or vbawol@veteranbastards.com. + Made for DayZ Epoch by axeman please ask permission to use/edit/distribute email gregory.andrew@gmail.com || vbawol@veteranbastards.com. */ private ["_hsRange","_rng","_pos","_hsCount","_nrstTrig","_objHouses","_objHouse","_nrTowers","_doRand","_rnd","_animlightpoint","_hasLight","_sleeptime","_lightstate","_objLightPoint"]; _rng = _this select 0;//Full distance to turn off all lights if required @@ -9,7 +9,7 @@ _doRand = _this select 2;//Random if gen not required otherwise just switch then _hsRange = _this select 4;//House range for randomly failing nearby (within lp distance)houses) _hasLight = false; -if(_doRand)then{//Randomly fail a nearby house - If generator skip and reset house variable so it can be lit again (reliability if gen nearby) +if(_doRand)then{//Randomly fail a nearby house - If generator skip && reset house variable so it can be lit again (reliability if gen nearby) _objHouses = nearestObjects [_nrstTrig, ["House"], _hsRange]; if(count _objHouses >3)then{ @@ -50,7 +50,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng]; if((abs ([([_x] call FNC_getPos), _objLightPoint] call BIS_fnc_distance2D))<1.5)then{ deleteVehicle _objLightPoint; }; - }forEach _objHouses; + }count _objHouses; }; if(count _objHouses >0)then{ @@ -58,7 +58,7 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng]; _x animate ["Lights_1",0]; _x animate ["Lights_2",0]; _x setVariable ["axeHLight", 0, false]; - }forEach _objHouses; + }count _objHouses; }; if(count _nrTowers >0)then{ @@ -71,6 +71,6 @@ _nrTowers = nearestObjects [_nrstTrig, ["Land_Ind_IlluminantTower"], _rng]; }; _x setVariable ["axeTLight", 0, false]; - }forEach _nrTowers; + }count _nrTowers; }; }; diff --git a/SQF/dayz_code/compile/local_lights_tower.sqf b/SQF/dayz_code/compile/local_lights_tower.sqf index 215f2a862..5e81c8321 100644 --- a/SQF/dayz_code/compile/local_lights_tower.sqf +++ b/SQF/dayz_code/compile/local_lights_tower.sqf @@ -15,5 +15,5 @@ if(count _nrTowers >0)then{ [_lCol,_lbrt,_lamb,[_x],[true]] call axe_towerLight; _x setVariable ["axeTLight", 1, false]; }; - }forEach _nrTowers; + }count _nrTowers; }; diff --git a/SQF/dayz_code/compile/local_roadDebris.sqf b/SQF/dayz_code/compile/local_roadDebris.sqf index 615f37528..f575068c2 100644 --- a/SQF/dayz_code/compile/local_roadDebris.sqf +++ b/SQF/dayz_code/compile/local_roadDebris.sqf @@ -13,4 +13,4 @@ private ["_spawnveh","_position","_direction","_veh"]; _veh setDir _direction; _veh setpos _position; -} forEach _this; \ No newline at end of file +} count _this; \ No newline at end of file diff --git a/SQF/dayz_code/compile/object_cargoCheck.sqf b/SQF/dayz_code/compile/object_cargoCheck.sqf index 83139f3bf..d6984fe85 100644 --- a/SQF/dayz_code/compile/object_cargoCheck.sqf +++ b/SQF/dayz_code/compile/object_cargoCheck.sqf @@ -36,7 +36,7 @@ _serial = 0; if (_itemQty != _oldQty) then {_change = true}; _serial = _serial + 1; -} forEach _currentTypes; +} count _currentTypes; //Review old loadout _serial = 0; @@ -52,6 +52,6 @@ _serial = 0; if (_itemQty != _oldQty) then {_change = true}; _serial = _serial + 1; -} forEach _previousTypes; +} count _previousTypes; _change \ No newline at end of file diff --git a/SQF/dayz_code/compile/object_monitorGear.sqf b/SQF/dayz_code/compile/object_monitorGear.sqf index 6eea39f43..a7ae4fb12 100644 --- a/SQF/dayz_code/compile/object_monitorGear.sqf +++ b/SQF/dayz_code/compile/object_monitorGear.sqf @@ -6,7 +6,7 @@ _countWeapons = { _return = 0; _weapons = (getWeaponCargo _object) select 1; - { _return = _return + _x } foreach _weapons; + { _return = _return + _x } count _weapons; _return; }; @@ -16,7 +16,7 @@ _countMagazines = { _return = 0; _magazines = (getMagazineCargo _object) select 1; - { _return = _return + _x } foreach _magazines; + { _return = _return + _x } count _magazines; _return; }; @@ -26,7 +26,7 @@ _countBackpacks = { _return = 0; _backpacks = (getBackpackCargo _object) select 1; - { _return = _return + _x } foreach _backpacks; + { _return = _return + _x } count _backpacks; _return; }; @@ -63,11 +63,11 @@ _isStorage = _object isKindOf "Land_A_tent"; _isnewstorage = (typeOf _object) in DZE_isNewStorage; _timeout = time + 2; -waitUntil { !(isNull (findDisplay 106)) or (_timeout < time) }; +waitUntil { !(isNull (findDisplay 106)) || (_timeout < time) }; //diag_log format["object_monitorGear.sqf: _object: %1 _isStorage: %4 _isVehicle: %2 _isMan: %3 _display: %5", _object, _isVehicle, _isMan, _isStorage, findDisplay 106]; -if ((_isVehicle or _isStorage or _isnewstorage) and (!_isMan) and (!(isNull (findDisplay 106)))) then { +if ((_isVehicle || _isStorage || _isnewstorage) && (!_isMan) && (!(isNull (findDisplay 106)))) then { _objectName = getText (configFile >> "CfgVehicles" >> (typeof _object) >> "displayName"); _controlText = [] call _getControlText; diff --git a/SQF/dayz_code/compile/object_processHit.sqf b/SQF/dayz_code/compile/object_processHit.sqf index dab19dcb7..2971ae8f3 100644 --- a/SQF/dayz_code/compile/object_processHit.sqf +++ b/SQF/dayz_code/compile/object_processHit.sqf @@ -11,11 +11,11 @@ if (local _unit) then { _unit setVariable [_strH,_total,true]; _break = false; - if (_selection in USEC_MinorWounds and _total >= 1 and _unit == player) then { + if (_selection in USEC_MinorWounds && _total >= 1 && _unit == player) then { _display = uiNamespace getVariable 'DAYZ_GUI_display'; _ctrlFracture = _display displayCtrl 1203; - if ((_selection == "legs") and !r_fracture_legs) then { + if ((_selection == "legs") && !r_fracture_legs) then { r_fracture_legs = true; _ctrlFracture ctrlShow true; _id = [] spawn { @@ -23,7 +23,7 @@ if (local _unit) then { }; _break = true; }; - if ((_selection == "arms") and !r_fracture_arms) then { + if ((_selection == "arms") && !r_fracture_arms) then { r_fracture_arms = true; _ctrlFracture ctrlShow true; _id = [] spawn { diff --git a/SQF/dayz_code/compile/object_removeNearby.sqf b/SQF/dayz_code/compile/object_removeNearby.sqf index 9516f5220..15c22f066 100644 --- a/SQF/dayz_code/compile/object_removeNearby.sqf +++ b/SQF/dayz_code/compile/object_removeNearby.sqf @@ -6,7 +6,7 @@ _error = _this select 2; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder); +_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); _nearByObjects = nearestObjects [player,_objects,_range]; @@ -15,7 +15,7 @@ if (count _nearByObjects == 0) exitWith { }; _targetObject = _nearByObjects select 0; -if (!isNull _targetObject and _canDo) then { +if (!isNull _targetObject && _canDo) then { [0,1,2,_targetObject] spawn player_removeObject; } else { cutText [(localize _error), "PLAIN DOWN"]; diff --git a/SQF/dayz_code/compile/object_setFixServer.sqf b/SQF/dayz_code/compile/object_setFixServer.sqf index 71e2f2294..d4cec88dd 100644 --- a/SQF/dayz_code/compile/object_setFixServer.sqf +++ b/SQF/dayz_code/compile/object_setFixServer.sqf @@ -3,7 +3,7 @@ _unit = _this select 0; _selection = _this select 1; _damage = _this select 2; -if (_selection != "" and local _unit) then { +if (_selection != "" && local _unit) then { _strH = "hit_" + (_selection); _unit setHit[_selection,_damage]; //player sidechat str _damage; diff --git a/SQF/dayz_code/compile/object_setHitServer.sqf b/SQF/dayz_code/compile/object_setHitServer.sqf index c2b08de63..49dae8937 100644 --- a/SQF/dayz_code/compile/object_setHitServer.sqf +++ b/SQF/dayz_code/compile/object_setHitServer.sqf @@ -2,7 +2,7 @@ private["_unit","_selection","_damage","_strH","_dam","_total"]; _unit = _this select 0; _selection = _this select 1; _damage = _this select 2; -if ((_selection != "") and local _unit) then { +if ((_selection != "") && local _unit) then { _strH = "hit_" + (_selection); _dam = _unit getVariable [_strH,0]; _total = (_dam + _damage); diff --git a/SQF/dayz_code/compile/object_speak.sqf b/SQF/dayz_code/compile/object_speak.sqf index f95933338..223552db9 100644 --- a/SQF/dayz_code/compile/object_speak.sqf +++ b/SQF/dayz_code/compile/object_speak.sqf @@ -39,12 +39,12 @@ if (count _this > 4) then { }; _isWoman = getText(configFile >> "cfgVehicles" >> (typeOf _unit) >> "TextPlural") == "Women"; -if (_isWoman and (_type in ["scream","panic"])) then { +if (_isWoman && (_type in ["scream","panic"])) then { _type = _type + "_w"; }; -if ((round(random _chance) == _chance) or (_chance == 0)) then { +if ((round(random _chance) == _chance) || (_chance == 0)) then { _rnd =(round(random _num)); _sound = "z_" + _type + "_" + str(_rnd); if (_local) then { diff --git a/SQF/dayz_code/compile/player_alertZombies.sqf b/SQF/dayz_code/compile/player_alertZombies.sqf index 5d520a482..67d68786a 100644 --- a/SQF/dayz_code/compile/player_alertZombies.sqf +++ b/SQF/dayz_code/compile/player_alertZombies.sqf @@ -27,4 +27,4 @@ if ("ItemMap_Debug" in items player) then { } else { _zombie setVariable ["myDest",_pos,true]; }; -} forEach _listTalk; \ No newline at end of file +} count _listTalk; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_animalCheck.sqf b/SQF/dayz_code/compile/player_animalCheck.sqf index dfb8ca329..66e26fedc 100644 --- a/SQF/dayz_code/compile/player_animalCheck.sqf +++ b/SQF/dayz_code/compile/player_animalCheck.sqf @@ -38,7 +38,7 @@ if (count _list < dayz_maxAnimals) then { _list = _Pos nearEntities [["CAAnimalBase","Man"],50]; - if (player distance _Pos < dayz_animalDistance and NOT surfaceIsWater _Pos and (count _list <= 1)) then { + if (player distance _Pos < dayz_animalDistance && NOT surfaceIsWater _Pos && (count _list <= 1)) then { if (_type == "DZ_Pastor") then { _agent = createAgent [_type, _Pos, [], 0, "NONE"]; } else { _agent = createAgent [_type, _Pos, [], 0, "FORM"]; }; _agent setpos _Pos; diff --git a/SQF/dayz_code/compile/player_antiWall.sqf b/SQF/dayz_code/compile/player_antiWall.sqf index 4e9e53245..f01037188 100644 --- a/SQF/dayz_code/compile/player_antiWall.sqf +++ b/SQF/dayz_code/compile/player_antiWall.sqf @@ -24,14 +24,14 @@ _intersectsWith = lineIntersectsWith [_playerPos, _vehiclePos, player, _vehicle] if ((count _intersectsWith) > 0) then { { // buildings - if (_x isKindOf "Building" or _x isKindOf "DZE_Housebase") exitWith { + if (_x isKindOf "Building" || _x isKindOf "DZE_Housebase") exitWith { _activated = true; }; // walls - if ((typeOf _x) == "" and {["wall_", str _x, false] call fnc_inString}) exitWith { + if ((typeOf _x) == "" && {["wall_", str _x, false] call fnc_inString}) exitWith { _activated = true; }; - } forEach _intersectsWith; + } count _intersectsWith; }; if(_activated) then { diff --git a/SQF/dayz_code/compile/player_checkStealth.sqf b/SQF/dayz_code/compile/player_checkStealth.sqf index a0acdb0df..831d63448 100644 --- a/SQF/dayz_code/compile/player_checkStealth.sqf +++ b/SQF/dayz_code/compile/player_checkStealth.sqf @@ -95,7 +95,7 @@ if (_scaleLight < 0.9) then { }; }; -//Ensure zero or above +//Ensure zero || above _scaleLight = _scaleLight max 0; //Terrain Visibility @@ -145,7 +145,7 @@ if (_isPlayerInside) then { //Work out result _audial = round(_speed * dayz_surfaceNoise * _scaleMvmt * _scaleSound); -if ((_audial > DAYZ_disAudial) or ((time - dayz_firedCooldown) > 0.3)) then { +if ((_audial > DAYZ_disAudial) || ((time - dayz_firedCooldown) > 0.3)) then { DAYZ_disAudial = _audial; }; diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index 5e23f2184..c9596d097 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -44,13 +44,13 @@ _array = _this; if (count _array > 0) then { _source = _array select 0; _method = _array select 1; - if ((!isNull _source) and (_source != player)) then { + if ((!isNull _source) && (_source != player)) then { _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (player getVariable["humanity",0]) <= -2000; - _punishment = _canHitFree or _isBandit; //if u are bandit or start first - player will not recieve humanity drop + _punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop _humanityHit = 0; if (!_punishment) then { - //i'm "not guilty" - kill me and be punished + //i'm "not guilty" - kill me && be punished _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000; _humanityHit = -(2000 - _myKills); _kills = _source getVariable ["humanKills",0]; diff --git a/SQF/dayz_code/compile/player_dumpBackpack.sqf b/SQF/dayz_code/compile/player_dumpBackpack.sqf index 51210a3b1..f33975be1 100644 --- a/SQF/dayz_code/compile/player_dumpBackpack.sqf +++ b/SQF/dayz_code/compile/player_dumpBackpack.sqf @@ -6,7 +6,7 @@ if (!(isNull _backpack)) then { _magazines = getMagazineCargo _backpack; _weaponscnt = count(_weapons select 0); _magazinescnt = count(_magazines select 0); - if ((_magazinescnt > 0) or(_weaponscnt > 0)) then{ + if ((_magazinescnt > 0) ||(_weaponscnt > 0)) then{ hideObject _backpack; }; }; diff --git a/SQF/dayz_code/compile/player_fired.sqf b/SQF/dayz_code/compile/player_fired.sqf index 364c01e0b..97ebfc642 100644 --- a/SQF/dayz_code/compile/player_fired.sqf +++ b/SQF/dayz_code/compile/player_fired.sqf @@ -44,7 +44,7 @@ if (_ammo isKindOf "SmokeShell") then { _group setVariable ["targets",_targets,true]; }; _i = _i + 1; - } forEach _listTalk; + } count _listTalk; } else { [_unit,_distance,true,(getPosATL player)] spawn player_alertZombies; //Check if need to place arrow @@ -65,11 +65,11 @@ if (_ammo isKindOf "SmokeShell") then { _pos = getPosATL player; _inRange = _pos nearEntities ["CAManBase",1250]; { - if(isPlayer _x and _x != player) then { + if(isPlayer _x && _x != player) then { PVDZE_send = [_x,"RoadFlare",[_projectile,0]]; publicVariableServer "PVDZE_send"; }; - } forEach _inRange; + } count _inRange; _id = _this spawn player_throwObject; }; @@ -81,11 +81,11 @@ if (_ammo isKindOf "SmokeShell") then { _pos = getPosATL player; _inRange = _pos nearEntities ["CAManBase",1250]; { - if(isPlayer _x and _x != player) then { + if(isPlayer _x && _x != player) then { PVDZE_send = [_x,"RoadFlare",[_projectile,1]]; publicVariableServer "PVDZE_send"; } - } forEach _inRange; + } count _inRange; _id = _this spawn player_throwObject; }; diff --git a/SQF/dayz_code/compile/player_gearSet.sqf b/SQF/dayz_code/compile/player_gearSet.sqf index 6ecc70b85..857546c12 100644 --- a/SQF/dayz_code/compile/player_gearSet.sqf +++ b/SQF/dayz_code/compile/player_gearSet.sqf @@ -30,7 +30,7 @@ if (count _inventory > 0) then { }; }; _idc = _idc + 1; - } forEach _mags; + } count _mags; //Add weapons { @@ -43,5 +43,5 @@ if (count _inventory > 0) then { if (_isOK) then { player addWeapon _x; }; - } forEach _wpns; + } count _wpns; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_gearSync.sqf b/SQF/dayz_code/compile/player_gearSync.sqf index fa5fba0e0..75127f121 100644 --- a/SQF/dayz_code/compile/player_gearSync.sqf +++ b/SQF/dayz_code/compile/player_gearSync.sqf @@ -5,7 +5,7 @@ _objects = nearestObjects [getPosATL player, dayz_updateObjects, 10]; PVDZE_veh_Update = [_x,"gear"]; publicVariableServer "PVDZE_veh_Update"; -} foreach _objects; +} count _objects; private["_dialog","_magazineArray","_control","_item","_val","_max"]; diff --git a/SQF/dayz_code/compile/player_harvest.sqf b/SQF/dayz_code/compile/player_harvest.sqf index 37da149c7..3455572df 100644 --- a/SQF/dayz_code/compile/player_harvest.sqf +++ b/SQF/dayz_code/compile/player_harvest.sqf @@ -4,7 +4,7 @@ _weapon = _this select 1; _ammo = _this select 4; _projectile = _this select 6; -if (_ammo isKindOf "Hatchet_Swing_Ammo" or _ammo isKindOf "Chainsaw_Swing_Ammo") then { +if (_ammo isKindOf "Hatchet_Swing_Ammo" || _ammo isKindOf "Chainsaw_Swing_Ammo") then { _findNearestTree = []; { @@ -20,7 +20,7 @@ if (_ammo isKindOf "Hatchet_Swing_Ammo" or _ammo isKindOf "Chainsaw_Swing_Ammo") }; }; }; - } foreach nearestObjects [getPosATL player, [], 20]; + } count nearestObjects [getPosATL player, [], 20]; //diag_log ("POSITION: " + str(_endPos)); diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index 9da8e7847..f90d8b00c 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -51,7 +51,7 @@ if (count _medical > 0) then { //["usecBleed",[player,_x,_hit]] call broadcastRpcCallAll; usecBleed = [player,_x,0]; publicVariable "usecBleed"; - } forEach (_medical select 8); + } count (_medical select 8); //Add fractures _fractures = (_medical select 9); diff --git a/SQF/dayz_code/compile/player_lockVault.sqf b/SQF/dayz_code/compile/player_lockVault.sqf index ca684742d..2408995d1 100644 --- a/SQF/dayz_code/compile/player_lockVault.sqf +++ b/SQF/dayz_code/compile/player_lockVault.sqf @@ -32,7 +32,7 @@ _ownerID = _obj getVariable["CharacterID","0"]; _objectID = _obj getVariable["ObjectID","0"]; _objectUID = _obj getVariable["ObjectUID","0"]; -if((_ownerID != dayz_combination) and (_ownerID != dayz_playerUID)) exitWith {DZE_ActionInProgress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_115"),_text], "PLAIN DOWN"]; }; +if((_ownerID != dayz_combination) && (_ownerID != dayz_playerUID)) exitWith {DZE_ActionInProgress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_115"),_text], "PLAIN DOWN"]; }; _alreadyPacking = _obj getVariable["packing",0]; if (_alreadyPacking == 1) exitWith {DZE_ActionInProgress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_116"),_text], "PLAIN DOWN"]}; diff --git a/SQF/dayz_code/compile/player_murderMenu.sqf b/SQF/dayz_code/compile/player_murderMenu.sqf index 0eabfee78..76fecacff 100644 --- a/SQF/dayz_code/compile/player_murderMenu.sqf +++ b/SQF/dayz_code/compile/player_murderMenu.sqf @@ -22,7 +22,7 @@ EpochDeathBoardLoad = { ];*/ { lbAdd [EpochDeathBoardDialogList, (_x select 0)]; - } forEach PVDZE_plr_DeathBResult; + } count PVDZE_plr_DeathBResult; }; @@ -34,7 +34,7 @@ EpochDeathBoardClick = { "What happens if you get scared half to death, twice?", "Don't upset me.. I'm running out of places to hide the bodies.", "Don't run, you'll just die tired.", - "Give me immortality or give me death.", + "Give me immortality || give me death.", "I can't live with death; he's always leaving the toilet seat up.", "Why won't you die?!?!", "Guns don't kill people; death kills people. It's a proven medical fact." diff --git a/SQF/dayz_code/compile/player_music.sqf b/SQF/dayz_code/compile/player_music.sqf index 2fd642671..030b233c5 100644 --- a/SQF/dayz_code/compile/player_music.sqf +++ b/SQF/dayz_code/compile/player_music.sqf @@ -4,7 +4,7 @@ while {!r_player_dead} do { _sound = "z_suspense_" + str(_num); _length = getNumber(configFile >> "cfgMusic" >> _sound >> "Duration"); _pause = ((random 5) + 2) + _length; - if (!r_player_unconscious and !r_pitchWhine) then { + if (!r_player_unconscious && !r_pitchWhine) then { playMusic _sound; }; sleep _pause; diff --git a/SQF/dayz_code/compile/player_onPause.sqf b/SQF/dayz_code/compile/player_onPause.sqf index 3f3f84881..92cae8b6e 100644 --- a/SQF/dayz_code/compile/player_onPause.sqf +++ b/SQF/dayz_code/compile/player_onPause.sqf @@ -17,7 +17,7 @@ dayz_lastCheckBit = time; if(r_fracture_legs && !r_player_dead) then {_btnRespawn ctrlEnable true;}; //force gear save -if (!r_player_dead and time - dayz_lastCheckBit > 10) then { +if (!r_player_dead && time - dayz_lastCheckBit > 10) then { call dayz_forceSave; }; @@ -26,17 +26,17 @@ _sleep = 1; while {!isNull _display} do { switch true do { - case (!r_player_dead and {isPlayer _x} count (player nearEntities ["AllVehicles", 12]) > 1) : { + case (!r_player_dead && {isPlayer _x} count (player nearEntities ["AllVehicles", 12]) > 1) : { _btnAbort ctrlEnable false; cutText [localize "str_abort_playerclose", "PLAIN DOWN"]; _sleep = 1; }; - case (!r_player_dead and !canbuild) : { + case (!r_player_dead && !canbuild) : { _btnAbort ctrlEnable false; cutText [(localize "str_epoch_player_12"), "PLAIN DOWN"]; _sleep = 1; }; - case (!r_player_dead and player getVariable["combattimeout", 0] >= time) : { + case (!r_player_dead && player getVariable["combattimeout", 0] >= time) : { _btnAbort ctrlEnable false; //cutText ["Cannot Abort while in combat!", "PLAIN DOWN"]; cutText [localize "str_abort_playerincombat", "PLAIN DOWN"]; diff --git a/SQF/dayz_code/compile/player_packTent.sqf b/SQF/dayz_code/compile/player_packTent.sqf index 83db8e3a5..3592ecc7f 100644 --- a/SQF/dayz_code/compile/player_packTent.sqf +++ b/SQF/dayz_code/compile/player_packTent.sqf @@ -41,7 +41,7 @@ sleep 3; _classname = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "create"); -if(!isNull _obj and alive _obj) then { +if(!isNull _obj && alive _obj) then { _location = _pos; @@ -78,7 +78,7 @@ if(!isNull _obj and alive _obj) then { { _holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Magazines _objWpnTypes = _magazines select 0; @@ -87,7 +87,7 @@ if(!isNull _obj and alive _obj) then { { _holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Backpacks _objWpnTypes = _backpacks select 0; @@ -96,7 +96,7 @@ if(!isNull _obj and alive _obj) then { { _holder addbackpackcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; cutText [localize "str_success_tent_pack", "PLAIN DOWN"]; diff --git a/SQF/dayz_code/compile/player_packVault.sqf b/SQF/dayz_code/compile/player_packVault.sqf index 08237686f..4df74db81 100644 --- a/SQF/dayz_code/compile/player_packVault.sqf +++ b/SQF/dayz_code/compile/player_packVault.sqf @@ -15,7 +15,7 @@ _text = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "displayName" // Silently exit if object no longer exists -if(isNull _obj or !(alive _obj)) exitWith { DZE_ActionInProgress = false; }; +if(isNull _obj || !(alive _obj)) exitWith { DZE_ActionInProgress = false; }; _playerNear = _obj call dze_isnearest_player; @@ -30,7 +30,7 @@ s_player_packvault = 1; if(_objectID == "0" && _objectUID == "0") exitWith {DZE_ActionInProgress = false; s_player_packvault = -1; cutText [format[(localize "str_epoch_player_118"),_text], "PLAIN DOWN"];}; -if((_ownerID != dayz_combination) and (_ownerID != dayz_playerUID)) exitWith { DZE_ActionInProgress = false; s_player_packvault = -1; cutText [format[(localize "str_epoch_player_119"),_text], "PLAIN DOWN"];}; +if((_ownerID != dayz_combination) && (_ownerID != dayz_playerUID)) exitWith { DZE_ActionInProgress = false; s_player_packvault = -1; cutText [format[(localize "str_epoch_player_119"),_text], "PLAIN DOWN"];}; _alreadyPacking = _obj getVariable["packing",0]; @@ -54,7 +54,7 @@ if(_location1 distance _location2 > 0.1) exitWith { _dir = direction _obj; _pos = _obj getVariable["OEMPos",(getposATL _obj)]; -if(!isNull _obj and alive _obj) then { +if(!isNull _obj && alive _obj) then { [1,1] call dayz_HungerThirst; player playActionNow "Medic"; @@ -94,7 +94,7 @@ if(!isNull _obj and alive _obj) then { { _holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Magazines _objWpnTypes = _magazines select 0; @@ -103,7 +103,7 @@ if(!isNull _obj and alive _obj) then { { _holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Backpacks _objWpnTypes = _backpacks select 0; @@ -112,7 +112,7 @@ if(!isNull _obj and alive _obj) then { { _holder addbackpackcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; cutText [format[(localize "str_epoch_player_123"),_text], "PLAIN DOWN"]; diff --git a/SQF/dayz_code/compile/player_projectileNear.sqf b/SQF/dayz_code/compile/player_projectileNear.sqf index 54dcc4ec4..3500ded56 100644 --- a/SQF/dayz_code/compile/player_projectileNear.sqf +++ b/SQF/dayz_code/compile/player_projectileNear.sqf @@ -32,7 +32,7 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do { if (isPlayer _nearVehicle) then { _isInCombat = _nearVehicle getVariable["startcombattimer",0]; - if ((alive _nearVehicle) and _isInCombat == 0) then { + if ((alive _nearVehicle) && _isInCombat == 0) then { _nearVehicle setVariable["startcombattimer", 1]; diag_log("Now in Combat (Player): " + name _unit); }; @@ -41,11 +41,11 @@ while {(alive _projectile) && !(isNull _projectile) && _callCount < 85;} do { if (_nearVehicle isKindOf "AllVehicles") then { { _isInCombat = _x getVariable["startcombattimer",0]; - if (isPlayer _x and _isInCombat == 0 and alive _x) then { + if (isPlayer _x && _isInCombat == 0 && alive _x) then { _x setVariable["startcombattimer", 1]; diag_log("Now in Combat (Crew): " + name _x); }; - } forEach (crew _nearVehicle); + } count (crew _nearVehicle); }; -} forEach _listNear; +} count _listNear; diff --git a/SQF/dayz_code/compile/player_spawnCheck.sqf b/SQF/dayz_code/compile/player_spawnCheck.sqf index 3fa3a65f7..e5d51fcb8 100644 --- a/SQF/dayz_code/compile/player_spawnCheck.sqf +++ b/SQF/dayz_code/compile/player_spawnCheck.sqf @@ -13,7 +13,7 @@ _position = getPosATL player; dayz_spawnZombies = 0; dayz_CurrentZombies = 0; -// experiment with adding fly sounds locally for both zombies and players. +// experiment with adding fly sounds locally for both zombies && players. _soundLimit = 2; { if (!alive _x) then { @@ -23,7 +23,7 @@ _soundLimit = 2; }; }; if (_soundLimit == 0) exitWith {}; -} foreach (nearestObjects [player, ["CAManBase"], 8]); +} count (nearestObjects [player, ["CAManBase"], 8]); _players = _position nearEntities ["CAManBase",_radius+200]; dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit; @@ -38,7 +38,7 @@ dayz_maxGlobalZombies = dayz_maxGlobalZombiesInit; dayz_CurrentZombies = dayz_CurrentZombies + 1; }; }; -} foreach _players; +} count _players; if ("ItemMap_Debug" in items player) then { deleteMarkerLocal "MaxZeds"; @@ -89,7 +89,7 @@ _nearby = _position nearObjects ["building",_radius]; _nearbyCount = count _nearby; if (_nearbyCount < 1) exitwith { - if ((dayz_spawnZombies < _maxWildZombies) and !_inVehicle) then { + if ((dayz_spawnZombies < _maxWildZombies) && !_inVehicle) then { [_position] call wild_spawnZombies; }; }; @@ -108,19 +108,19 @@ if (_nearbyCount < 1) exitwith _dis = _x distance player; //Loot - if ((_dis < 120) and (_dis > 30) and !_inVehicle) then { + if ((_dis < 120) && (_dis > 30) && !_inVehicle) then { _looted = (_x getVariable ["looted",-0.1]); _cleared = (_x getVariable ["cleared",true]); _dateNow = (DateToNumber date); _age = (_dateNow - _looted) * 525948; //diag_log ("SPAWN LOOT: " + _type + " Building is " + str(_age) + " old" ); - if ((_age > DZE_LootSpawnTimer) and (!_cleared)) then { + if ((_age > DZE_LootSpawnTimer) && (!_cleared)) then { _nearByObj = nearestObjects [(getPosATL _x), ["WeaponHolder","WeaponHolderBase"],((sizeOf _type)+5)]; - {deleteVehicle _x} forEach _nearByObj; + {deleteVehicle _x} count _nearByObj; _x setVariable ["cleared",true,true]; _x setVariable ["looted",_dateNow,true]; }; - if ((_age > DZE_LootSpawnTimer) and (_cleared)) then { + if ((_age > DZE_LootSpawnTimer) && (_cleared)) then { //Register _x setVariable ["looted",_dateNow,true]; //cleanup @@ -150,4 +150,4 @@ if (_nearbyCount < 1) exitwith }; }; }; -} forEach _nearby; +} count _nearby; diff --git a/SQF/dayz_code/compile/player_switchModel.sqf b/SQF/dayz_code/compile/player_switchModel.sqf index 2206489cb..4271e2d00 100644 --- a/SQF/dayz_code/compile/player_switchModel.sqf +++ b/SQF/dayz_code/compile/player_switchModel.sqf @@ -56,29 +56,29 @@ _newUnit setPosATL _position; _newUnit setDir _dir; //Clear New Character -{_newUnit removeMagazine _x;} forEach magazines _newUnit; +{_newUnit removeMagazine _x;} count magazines _newUnit; removeAllWeapons _newUnit; //Equip New Charactar { if (typeName _x == "ARRAY") then {if ((count _x) > 0) then {_newUnit addMagazine [(_x select 0), (_x select 1)]; }; } else { _newUnit addMagazine _x; }; -} forEach _magazines; +} count _magazines; { _newUnit addWeapon _x; -} forEach _weapons; +} count _weapons; -//Check and Compare it +//Check && Compare it if(str(_weapons) != str(weapons _newUnit)) then { //Get Differecnce { _weapons = _weapons - [_x]; - } forEach (weapons _newUnit); + } count (weapons _newUnit); //Add the Missing { _newUnit addWeapon _x; - } forEach _weapons; + } count _weapons; }; if(_primweapon != (primaryWeapon _newUnit)) then { @@ -108,11 +108,11 @@ _switchUnit = { setPlayable _newUnit; selectPlayer _newUnit; removeAllWeapons _oldUnit; - {_oldUnit removeMagazine _x;} forEach magazines _oldUnit; + {_oldUnit removeMagazine _x;} count magazines _oldUnit; deleteVehicle _oldUnit; if(_currentWpn != "") then {_newUnit selectWeapon _currentWpn;}; }; -//Add and Fill BackPack +//Add && Fill BackPack if (!isNil "_newBackpackType") then { if (_newBackpackType != "") then { _newUnit addBackpack _newBackpackType; @@ -140,13 +140,13 @@ if (!isNil "_newBackpackType") then { (unitBackpack player) addMagazineCargoGlobal [_x, 1]; }; }; - } forEach _backpackMag; + } count _backpackMag; (findDisplay 106) closeDisplay 0; _countr = 0; { (unitBackpack player) addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)]; _countr = _countr + 1; - } forEach _backpackWpnTypes; + } count _backpackWpnTypes; } else { [] call _switchUnit; }; } else { [] call _switchUnit; }; [objNull, player, rSwitchMove,_currentAnim] call RE; @@ -171,4 +171,4 @@ if (_ismelee == "true") then { }; //reveal the same objects we do on login -{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]); \ No newline at end of file +{player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]); \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_traderMenuConfig.sqf b/SQF/dayz_code/compile/player_traderMenuConfig.sqf index 3554161ff..c3a5062ea 100644 --- a/SQF/dayz_code/compile/player_traderMenuConfig.sqf +++ b/SQF/dayz_code/compile/player_traderMenuConfig.sqf @@ -175,7 +175,7 @@ TraderDialogLoadItemList = { _header, _File ]]; - } forEach PVDZE_plr_TradeMenuResult; + } count PVDZE_plr_TradeMenuResult; TraderItemList = _item_list; }; diff --git a/SQF/dayz_code/compile/player_traderMenuHive.sqf b/SQF/dayz_code/compile/player_traderMenuHive.sqf index bcdc2a7cd..e8ad91526 100644 --- a/SQF/dayz_code/compile/player_traderMenuHive.sqf +++ b/SQF/dayz_code/compile/player_traderMenuHive.sqf @@ -16,7 +16,7 @@ TraderDialogLoadItemList = { TraderItemList = -1; _index = _this select 0; - if (_index < 0 or TraderCurrentCatIndex == _index) exitWith {}; + if (_index < 0 || TraderCurrentCatIndex == _index) exitWith {}; TraderCurrentCatIndex = _index; _trader_id = TraderCatList select _index; @@ -163,7 +163,7 @@ TraderDialogLoadItemList = { _header, _File ]]; - } forEach PVDZE_plr_TradeMenuResult; + } count PVDZE_plr_TradeMenuResult; TraderItemList = _item_list; }; diff --git a/SQF/dayz_code/compile/player_unlockVault.sqf b/SQF/dayz_code/compile/player_unlockVault.sqf index e705dc6d4..8bd451c6a 100644 --- a/SQF/dayz_code/compile/player_unlockVault.sqf +++ b/SQF/dayz_code/compile/player_unlockVault.sqf @@ -8,7 +8,7 @@ private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_holder","_we if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; }; DZE_ActionInProgress = true; -{player removeAction _x} forEach s_player_combi;s_player_combi = []; +{player removeAction _x} count s_player_combi;s_player_combi = []; s_player_unlockvault = 1; _obj = _this; @@ -22,8 +22,8 @@ if (!(_objType in DZE_LockedStorage)) exitWith { _playerNear = _obj call dze_isnearest_player; if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_20") , "PLAIN DOWN"]; }; -// Silently exit if object no longer exists or alive -if(isNull _obj or !(alive _obj)) exitWith { DZE_ActionInProgress = false; }; +// Silently exit if object no longer exists || alive +if(isNull _obj || !(alive _obj)) exitWith { DZE_ActionInProgress = false; }; _unlockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "unlockedClass"); _text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName"); @@ -35,14 +35,14 @@ _ownerID = _obj getVariable["CharacterID","0"]; if (_alreadyPacking == 1) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_124"),_text], "PLAIN DOWN"]}; // Promt user for password if _ownerID != dayz_playerUID -if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { +if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then { // Check if any players are nearby if not allow player to claim item. _playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1; _playerID = getPlayerUID player; // Only allow if not already claimed. - if (_claimedBy == "0" or !_playerNear) then { + if (_claimedBy == "0" || !_playerNear) then { // Since item was not claimed proceed with claiming it. _obj setVariable["claimed",_playerID,true]; }; @@ -56,7 +56,7 @@ if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { if (_claimedBy == _playerID) then { - if(!isNull _obj and alive _obj) then { + if(!isNull _obj && alive _obj) then { PVDZE_log_lockUnlock = [player, _obj, false]; publicVariableServer "PVDZE_log_lockUnlock"; @@ -91,7 +91,7 @@ if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { { _holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; }; if (count _magazines > 0) then { @@ -105,7 +105,7 @@ if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { _holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; }; - } forEach _objWpnTypes; + } count _objWpnTypes; }; if (count _backpacks > 0) then { @@ -116,7 +116,7 @@ if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { { _holder addbackpackcargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; }; cutText [format[(localize "str_epoch_player_125"),_text], "PLAIN DOWN"]; diff --git a/SQF/dayz_code/compile/player_updateGui.sqf b/SQF/dayz_code/compile/player_updateGui.sqf index 93ccf9146..7dcd68766 100644 --- a/SQF/dayz_code/compile/player_updateGui.sqf +++ b/SQF/dayz_code/compile/player_updateGui.sqf @@ -69,9 +69,9 @@ if (_foodLvl < 0) then { _foodLvl = 0 }; _food = "\z\addons\dayz_code\gui\status_food_inside_" + str(_foodLvl) + "_ca.paa"; if ( _tempLvl >= 36 ) then { _tempImg = 4 }; -if ( _tempLvl > 33 and _tempLvl < 36 ) then { _tempImg = 3 }; -if ( _tempLvl >= 30 and _tempLvl <= 33 ) then { _tempImg = 2 }; -if ( _tempLvl > 28 and _tempLvl < 30 ) then { _tempImg = 1 }; +if ( _tempLvl > 33 && _tempLvl < 36 ) then { _tempImg = 3 }; +if ( _tempLvl >= 30 && _tempLvl <= 33 ) then { _tempImg = 2 }; +if ( _tempLvl > 28 && _tempLvl < 30 ) then { _tempImg = 1 }; if ( _tempLvl <= 28 ) then { _tempImg = 0 }; _temp = "\z\addons\dayz_code\gui\status_temp_" + str(_tempImg) + "_ca.paa"; @@ -142,7 +142,7 @@ Opt-in tag system with friend tagging _targetControl = _display displayCtrl 1199; _string = ""; _humanityTarget = cursorTarget; -if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarget) then { +if (!isNull _humanityTarget && isPlayer _humanityTarget && alive _humanityTarget) then { _distance = (player distance _humanityTarget); @@ -150,7 +150,7 @@ if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarg _size = (1-(floor(_distance/5)*0.1)) max 0.1; - // Display name if player opt-in or if friend + // Display name if player opt-in || if friend _friendlies = player getVariable ["friendlies", []]; _charID = player getVariable ["CharacterID", "0"]; @@ -158,7 +158,7 @@ if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarg _rfriendlies = _humanityTarget getVariable ["friendlies", []]; _rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []]; - if ((_rcharID in _friendlies) and (_charID in _rfriendlies)) then { + if ((_rcharID in _friendlies) && (_charID in _rfriendlies)) then { if (!(_charID in _rfriendlyTo)) then { @@ -189,7 +189,7 @@ if (!isNull _humanityTarget and isPlayer _humanityTarget and alive _humanityTarg _color = "color='#3333ff'"; }; }; - if((_humanityTarget getVariable ["DZE_display_name", false]) or (DZE_ForceNameTagsInTrader && isInTraderCity)) then { + if((_humanityTarget getVariable ["DZE_display_name", false]) || (DZE_ForceNameTagsInTrader && isInTraderCity)) then { _humanityName = if (alive _humanityTarget) then {name _humanityTarget; } else { "Dead Player";}; _string = format["%1",_humanityName,_color,_size]; }; diff --git a/SQF/dayz_code/compile/player_upgradeVehicle.sqf b/SQF/dayz_code/compile/player_upgradeVehicle.sqf index 20de95f9a..f54562cad 100644 --- a/SQF/dayz_code/compile/player_upgradeVehicle.sqf +++ b/SQF/dayz_code/compile/player_upgradeVehicle.sqf @@ -16,10 +16,10 @@ if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [( _findNearestVehicles = nearestObjects [player, ["LandVehicle"], 10]; _findNearestVehicle = []; { - if (alive _x and (count (crew _x)) == 0) exitWith { + if (alive _x && (count (crew _x)) == 0) exitWith { _findNearestVehicle set [(count _findNearestVehicle),_x]; }; -} foreach _findNearestVehicles; +} count _findNearestVehicles; _IsNearVehicle = count (_findNearestVehicle); if (_IsNearVehicle >= 1) then { @@ -28,11 +28,11 @@ if (_IsNearVehicle >= 1) then { _notNearestPlayer = _vehicle call dze_isnearest_player; - if (!isNull _vehicle and local _vehicle and !_notNearestPlayer) then { + if (!isNull _vehicle && local _vehicle && !_notNearestPlayer) then { _classname = typeOf _vehicle; - // lookup vehicle and find if any upgrades are available + // lookup vehicle && find if any upgrades are available _upgrade = getArray (configFile >> "CfgVehicles" >> _classname >> "Upgrades" >> _upgrade); if (!isNil "_upgrade" && (count _upgrade) > 0) then { @@ -50,13 +50,13 @@ if (_IsNearVehicle >= 1) then { _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player; if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirementsMagazine; + } count _requirementsMagazine; { _itemIn = _x select 0; _countIn = _x select 1; _qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn) } count weapons player; if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; }; - } forEach _requirementsWeapon; + } count _requirementsWeapon; if (_proceed) then { @@ -84,8 +84,8 @@ if (_IsNearVehicle >= 1) then { _temp_removed_array_mag set [count _temp_removed_array_mag,_x]; }; }; - } forEach magazines player; - } forEach _requirementsMagazine; + } count magazines player; + } count _requirementsMagazine; { _removed = 0; @@ -103,8 +103,8 @@ if (_IsNearVehicle >= 1) then { _temp_removed_array_wep set [count _temp_removed_array_wep,_x]; }; }; - } forEach weapons player; - } forEach _requirementsWeapon; + } count weapons player; + } count _requirementsWeapon; // all parts removed proceed if (_tobe_removed_total == _removed_total) then { @@ -132,8 +132,8 @@ if (_IsNearVehicle >= 1) then { }; } else { - {player addMagazine _x;} forEach _temp_removed_array_mag; - {player addWeapon _x;} forEach _temp_removed_array_wep; + {player addMagazine _x;} count _temp_removed_array_mag; + {player addWeapon _x;} count _temp_removed_array_wep; cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"]; }; } diff --git a/SQF/dayz_code/compile/player_weaponCheck.sqf b/SQF/dayz_code/compile/player_weaponCheck.sqf index 38d7a83eb..b24654204 100644 --- a/SQF/dayz_code/compile/player_weaponCheck.sqf +++ b/SQF/dayz_code/compile/player_weaponCheck.sqf @@ -17,7 +17,7 @@ _newObjects = []; }; _newObjects set [count _newObjects,_type]; }; -} forEach _currentObjects; +} count _currentObjects; //Compare current loadout with old loadout _newObjects = []; @@ -31,6 +31,6 @@ _newObjects = []; }; _newObjects set [count _newObjects,_type]; }; -} forEach _checkObjects; +} count _checkObjects; _change; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_weaponFiredNear.sqf b/SQF/dayz_code/compile/player_weaponFiredNear.sqf index 5173fb59d..0ec2c5958 100644 --- a/SQF/dayz_code/compile/player_weaponFiredNear.sqf +++ b/SQF/dayz_code/compile/player_weaponFiredNear.sqf @@ -13,13 +13,13 @@ private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_ _arc = 60; _isBallistic = (getNumber (configfile >> "CfgAmmo" >> _ammo >> "whistleOnFire") > 0); _dmgDistance = getNumber (configfile >> "CfgAmmo" >> _ammo >> "whistleDist"); - _isRocket = ((_ammo isKindOf "RocketBase") and (_firer isKindOf "Man")); + _isRocket = ((_ammo isKindOf "RocketBase") && (_firer isKindOf "Man")); _isPlayer = (_unit == player); _inVehicle = (vehicle _unit != _unit); _evType = ""; _recordable = false; - // Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4 + // Both the firer && those nearby (<=8m) go into "combat" to prevent ALT-F4 //diag_log ("DEBUG: AMMO TYPE: " +str(_ammo)); _firer setVariable["startcombattimer", 1]; if (_distance <= 8) then { @@ -44,7 +44,7 @@ private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_ _isInRear = (_firingArc > (180 - _arc)); //Ballistic Handler - if ((_isBallistic and _isInFront) and (_distance < (_dmgDistance * 2))) then { + if ((_isBallistic && _isInFront) && (_distance < (_dmgDistance * 2))) then { if (_distance < _dmgDistance) then { //Will Cause Damage 1 call fnc_usec_bulletHit; @@ -68,8 +68,8 @@ private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_ }; }; } else { - if (_isRocket and (_isInFront or _isInRear)) then { - if ((_distance < 5) and !_handled) then { + if (_isRocket && (_isInFront || _isInRear)) then { + if ((_distance < 5) && !_handled) then { 1 call fnc_usec_bulletHit; [20,45] call fnc_usec_pitchWhine; //Visual , Sound // Dead @@ -78,12 +78,12 @@ private ["_unit","_evType","_recordable","_inVehicle","_isPlayer","_isRocket","_ }; [_unit,2] call fnc_usec_damageUnconscious; }; - if ((_distance < 10) and !_handled) then { + if ((_distance < 10) && !_handled) then { [10,20] call fnc_usec_pitchWhine; //Visual , Sound // Unconscious [_unit,0.2] call fnc_usec_damageUnconscious; }; - if ((_distance < 20) and !_handled and _isPlayer) then { + if ((_distance < 20) && !_handled && _isPlayer) then { // Warn [10,20] call fnc_usec_pitchWhine; //Visual , Sound addCamShake [15, 0.8, 25]; diff --git a/SQF/dayz_code/compile/player_zombieAttack.sqf b/SQF/dayz_code/compile/player_zombieAttack.sqf index 29ae079fd..0df925128 100644 --- a/SQF/dayz_code/compile/player_zombieAttack.sqf +++ b/SQF/dayz_code/compile/player_zombieAttack.sqf @@ -5,7 +5,7 @@ _vehicle = (vehicle player); _targets = _unit getVariable ["targets",[]]; -if (!dayz_zedsAttackVehicles and !(_vehicle in _targets)) exitWith { +if (!dayz_zedsAttackVehicles && !(_vehicle in _targets)) exitWith { //diag_log ("not attacking vehicle" + str(_vehicle)); }; @@ -56,7 +56,7 @@ if (_vehicle != player) then { if (_vehicle isKindOf _x) exitWith { player action ["eject", _vehicle]; }; - } forEach _openVehicles; + } count _openVehicles; }; //diag_log ("Hitpoints " +str(_wound) + "hit points " + str(_hpList)); @@ -89,7 +89,7 @@ if (_vehicle != player) then { } else { //diag_log ("Animation state: " +(_currentAnim)); _attackanimations = ["zombiestandingattack1","zombiestandingattack2","zombiestandingattack3","zombiestandingattack4","zombiestandingattack5","zombiestandingattack6","zombiestandingattack7","zombiestandingattack8","zombiestandingattack9","zombiestandingattack10","zombiefeed1","zombiefeed2","zombiefeed3","zombiefeed4","zombiefeed5"]; - if (((_unit distance player) <= dayz_areaAffect) and ((animationState _unit) in _attackanimations)) then { + if (((_unit distance player) <= dayz_areaAffect) && ((animationState _unit) in _attackanimations)) then { //check LOS _inAngle = [_zPos,(getdir _unit),50,_tPos] call fnc_inAngleSector; if (_inAngle) then { diff --git a/SQF/dayz_code/compile/player_zombieCheck.sqf b/SQF/dayz_code/compile/player_zombieCheck.sqf index 44ee80bbf..396cb165b 100644 --- a/SQF/dayz_code/compile/player_zombieCheck.sqf +++ b/SQF/dayz_code/compile/player_zombieCheck.sqf @@ -14,7 +14,7 @@ _attacked = false; _dist = (_x distance _refObj); _chance = 1; - if ((_dist < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then { + if ((_dist < dayz_areaAffect) && !(animationState _x == "ZombieFeed")) then { //diag_log ("within attack range: " + str(_x)); @@ -23,7 +23,7 @@ _attacked = false; _last = _x getVariable["lastAttack",0]; _entHeight = (getPosATL _x) select 2; _delta = _pHeight - _entHeight; - if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then + if ( ((time - _last) > 1) && ((_delta < 1.5) && (_delta > -1.5)) ) then { //diag_log ("perform attack: " + str(_x)); [_x, _type] spawn player_zombieAttack; @@ -41,7 +41,7 @@ _attacked = false; }; //Noise Activation _targets = _x getVariable ["targets",[]]; - if (!(_refObj in _targets) and !isNull _refObj) then { + if (!(_refObj in _targets) && !isNull _refObj) then { if (_dist < DAYZ_disAudial) then { if (DAYZ_disAudial > 80) then { @@ -72,7 +72,7 @@ _attacked = false; }; //Sight Activation _targets = _x getVariable ["targets",[]]; - if (!(_refObj in _targets) and !isNull _refObj) then { + if (!(_refObj in _targets) && !isNull _refObj) then { if (_dist < DAYZ_disVisual) then { _tPos = (getPosASL _refObj); @@ -95,7 +95,7 @@ _attacked = false; }; }; }; -} forEach _listTalk; +} count _listTalk; if (_attacked) then { if (r_player_unconscious) then { diff --git a/SQF/dayz_code/compile/spawn_loot.sqf b/SQF/dayz_code/compile/spawn_loot.sqf index ed6798ad1..180c6afa6 100644 --- a/SQF/dayz_code/compile/spawn_loot.sqf +++ b/SQF/dayz_code/compile/spawn_loot.sqf @@ -8,7 +8,7 @@ _uniq = []; _item = objNull; _iPosZ = _iPos select 2; -if((isNil "_iPosZ") OR {( _iPosZ < 0)}) then { _iPos = [_iPos select 0,_iPos select 1,0]; }; +if((isNil "_iPosZ") || {( _iPosZ < 0)}) then { _iPos = [_iPos select 0,_iPos select 1,0]; }; if (isNil "_iClass") exitWith {diag_log "_iClass isNil, exiting loot spawn!";}; switch (_iClass) do { @@ -17,11 +17,11 @@ switch (_iClass) do { if (DZE_MissionLootTable) then { { _itemTypes set [count _itemTypes, _x select 0] - } foreach getArray (missionConfigFile >> "cfgLoot" >> _iClass); + } count getArray (missionConfigFile >> "cfgLoot" >> _iClass); } else { { _itemTypes set [count _itemTypes, _x select 0] - } foreach getArray (configFile >> "cfgLoot" >> _iClass); + } count getArray (configFile >> "cfgLoot" >> _iClass); }; _qty = 0; _max = ceil(random 2) + 1; @@ -101,12 +101,12 @@ switch (_iClass) do { if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "cfgLoot" >> _iClass); + } count getArray(missionConfigFile >> "cfgLoot" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "cfgLoot" >> _iClass); + } count getArray(configFile >> "cfgLoot" >> _iClass); }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; @@ -139,12 +139,12 @@ switch (_iClass) do { if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "cfgLoot" >> _iClass); + } count getArray(missionConfigFile >> "cfgLoot" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "cfgLoot" >> _iClass); + } count getArray(configFile >> "cfgLoot" >> _iClass); }; _index = dayz_CLBase find _iItem; _weights = dayz_CLChances select _index; @@ -158,7 +158,7 @@ switch (_iClass) do { _iItem = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"] call BIS_fnc_selectRandom; }; - //Item is a weapon, add it and a random quantity of magazines + //Item is a weapon, add it && a random quantity of magazines _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; _item addWeaponCargoGlobal [_iItem,1]; _mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines"); @@ -174,7 +174,7 @@ switch (_iClass) do { }; case "weapon": { - //Item is a weapon, add it and a random quantity of magazines + //Item is a weapon, add it && a random quantity of magazines _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; _item addWeaponCargoGlobal [_iItem,1]; _mags = [] + getArray (configFile >> "cfgWeapons" >> _iItem >> "magazines"); @@ -194,7 +194,7 @@ switch (_iClass) do { }; case "weaponnomags": { - //Item is a weapon, and spawns no mags + //Item is a weapon, && spawns no mags _item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"]; _item addWeaponCargoGlobal [_iItem,1]; }; diff --git a/SQF/dayz_code/compile/spawn_loot_small.sqf b/SQF/dayz_code/compile/spawn_loot_small.sqf index 9c6645708..9c755ec06 100644 --- a/SQF/dayz_code/compile/spawn_loot_small.sqf +++ b/SQF/dayz_code/compile/spawn_loot_small.sqf @@ -19,12 +19,12 @@ switch (_iClass) do if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); + } count getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "CfgLootSmall" >> _iClass); + } count getArray(configFile >> "CfgLootSmall" >> _iClass); }; _index = dayzE_CLSBase find _iClass; @@ -45,12 +45,12 @@ switch (_iClass) do if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); + } count getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "CfgLootSmall" >> _iClass); + } count getArray(configFile >> "CfgLootSmall" >> _iClass); }; _index = dayzE_CLSBase find _iItem; _weights = dayzE_CLSChances select _index; @@ -70,12 +70,12 @@ switch (_iClass) do if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); + } count getArray(missionConfigFile >> "CfgLootSmall" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "CfgLootSmall" >> _iClass); + } count getArray(configFile >> "CfgLootSmall" >> _iClass); }; _index = dayzE_CLSBase find _iItem; _weights = dayzE_CLSChances select _index; diff --git a/SQF/dayz_code/compile/ui_changeDisplay.sqf b/SQF/dayz_code/compile/ui_changeDisplay.sqf index b63bb549e..bf8540937 100644 --- a/SQF/dayz_code/compile/ui_changeDisplay.sqf +++ b/SQF/dayz_code/compile/ui_changeDisplay.sqf @@ -2,7 +2,7 @@ private["_state"]; disableSerialization; _state = uiNamespace getVariable ['DZ_displayUI', 0]; -// Hard code the GUI on and the Debug Monitor off +// Hard code the GUI on && the Debug Monitor off if (dayzState != 0) then { 3 cutRsc ["playerStatusGUI", "PLAIN",0]; //Update GUI diff --git a/SQF/dayz_code/compile/ui_gear_sound.sqf b/SQF/dayz_code/compile/ui_gear_sound.sqf index 3f67659f3..b9d751bf3 100644 --- a/SQF/dayz_code/compile/ui_gear_sound.sqf +++ b/SQF/dayz_code/compile/ui_gear_sound.sqf @@ -16,7 +16,7 @@ if( (!isNull cursorTarget) && (player distance cursorTarget < 5) && (vehicle pla }; }; -/*Player doesn't have a cursor target, or its too far away, or they are in a vehicle. +/*Player doesn't have a cursor target, || its too far away, || they are in a vehicle. else{ if ( (vehicle player != player) && (vehicle player isKindOf "AllVehicles") ) then { //Player is in a vehicle, placeholder for vehicle trunk sounds(if added) diff --git a/SQF/dayz_code/compile/ui_selectSlot.sqf b/SQF/dayz_code/compile/ui_selectSlot.sqf index 236cbc3b1..2b5f35a7b 100644 --- a/SQF/dayz_code/compile/ui_selectSlot.sqf +++ b/SQF/dayz_code/compile/ui_selectSlot.sqf @@ -42,7 +42,7 @@ if (_button == 1) then { /* This flag means that the action is output oriented the output class will then be transferred to the script - and the type used for the name + && the type used for the name */ _array = getArray (_config >> "output"); _outputClass = _array select 0; diff --git a/SQF/dayz_code/compile/vehicle_handleKilled.sqf b/SQF/dayz_code/compile/vehicle_handleKilled.sqf index 6e1a3054d..f1f86356b 100644 --- a/SQF/dayz_code/compile/vehicle_handleKilled.sqf +++ b/SQF/dayz_code/compile/vehicle_handleKilled.sqf @@ -7,7 +7,7 @@ _hitPoints = _unit call vehicle_getHitpoints; { _selection = getText (configFile >> "CfgVehicles" >> (typeof _unit) >> "HitPoints" >> _x >> "name"); _unit setVariable [_selection, 1, true]; -} forEach _hitPoints; +} count _hitPoints; //["PVDZE_veh_Update",[_unit, "damage"]] call callRpcProcedure; if (isServer) then { diff --git a/SQF/dayz_code/compile/wild_spawnZombies.sqf b/SQF/dayz_code/compile/wild_spawnZombies.sqf index 42bf8e000..d614b2a5e 100644 --- a/SQF/dayz_code/compile/wild_spawnZombies.sqf +++ b/SQF/dayz_code/compile/wild_spawnZombies.sqf @@ -15,7 +15,7 @@ _agent = objNull; _type = _unitTypes call BIS_fnc_selectRandom; -//Create the Group and populate it +//Create the Group && populate it //diag_log ("Spawned: " + _type); _radius = 40; _method = "NONE"; @@ -64,7 +64,7 @@ if (_rnd > 0.3) then { _array = []; { _array set [count _array, _x select 0] - } foreach _lootTypeCfg; + } count _lootTypeCfg; if (count _array > 0) then { _index = dayz_CLBase find _lootType; _weights = dayz_CLChances select _index; diff --git a/SQF/dayz_code/compile/zombie_findTarget.sqf b/SQF/dayz_code/compile/zombie_findTarget.sqf index 21a583cea..ad09401f3 100644 --- a/SQF/dayz_code/compile/zombie_findTarget.sqf +++ b/SQF/dayz_code/compile/zombie_findTarget.sqf @@ -9,7 +9,7 @@ _range = 500; _assigned = _group getVariable ["targets",[]]; { _group reveal [_x,4]; -} forEach _assigned; +} count _assigned; //Find targets _targets = _lead nearTargets _range; @@ -17,14 +17,14 @@ _targets = _lead nearTargets _range; private["_obj","_dis"]; _obj = _x select 4; _dis = _obj distance _lead; - if (_obj isKindOf "Man" and ((speed _obj) < 15)) then { - if (!(_obj isKindOf "zZombie_Base") and !(_obj in _targetMen)) then { + if (_obj isKindOf "Man" && ((speed _obj) < 15)) then { + if (!(_obj isKindOf "zZombie_Base") && !(_obj in _targetMen)) then { //process man targets _targetMen set [count _targetMen,_obj]; _targetDis set [count _targetDis,_dis]; }; }; -} forEach _targets; +} count _targets; //Search for fires if (count _targetMen == 0) then { @@ -32,15 +32,15 @@ if (count _targetMen == 0) then { { private["_dis"]; _dis = _x distance _lead; - if ((_dis < _range) and !(_x in _targetMen)) then { + if ((_dis < _range) && !(_x in _targetMen)) then { _rnd = random 1; if (_rnd < 0.5) then { - if ((inflamed _x) or (_x isKindOf "SmokeShell")) then { + if ((inflamed _x) || (_x isKindOf "SmokeShell")) then { _targetMen set [count _targetMen,_x]; _targetDis set [count _targetDis,_dis]; } else { if (_x isKindOf "Generator_DZ") then { - if (alive _x and (_x getVariable ["GeneratorRunning", false])) then { + if (alive _x && (_x getVariable ["GeneratorRunning", false])) then { _targetMen set [count _targetMen,_x]; _targetDis set [count _targetDis,_dis]; }; @@ -48,7 +48,7 @@ if (count _targetMen == 0) then { }; }; }; - } forEach _fires; + } count _fires; }; //Find best target @@ -68,7 +68,7 @@ if (count _targetMen > 0) then { _manDis = _dis; }; _c = _c + 1; - } forEach _targetMen; + } count _targetMen; _target = _man; }; diff --git a/SQF/dayz_code/compile/zombie_findTargetAgent.sqf b/SQF/dayz_code/compile/zombie_findTargetAgent.sqf index 2ec36bf4f..92d73340c 100644 --- a/SQF/dayz_code/compile/zombie_findTargetAgent.sqf +++ b/SQF/dayz_code/compile/zombie_findTargetAgent.sqf @@ -43,7 +43,7 @@ if (count _targets == 0) then _targets set [count _targets,_x]; _targetDis set [count _targetDis,_dis]; }; - } forEach _objects; + } count _objects; }; //Find best target @@ -68,7 +68,7 @@ if (count _targets > 0) then _man = _x; _manDis = _dis; }; - } forEach _targets; + } count _targets; _target = _man; }; diff --git a/SQF/dayz_code/compile/zombie_generate.sqf b/SQF/dayz_code/compile/zombie_generate.sqf index e1f481e80..408017631 100644 --- a/SQF/dayz_code/compile/zombie_generate.sqf +++ b/SQF/dayz_code/compile/zombie_generate.sqf @@ -32,21 +32,21 @@ _cantSee = { _deg = [_xasl, _zPos] call BIS_fnc_dirTo; _deg = (_deg - _ed + 720) % 360; if (_deg > 180) then { _deg = _deg - 360; }; - if ((abs(_deg) < _fov) AND {( // in right angle sector? + if ((abs(_deg) < _fov) && {( // in right angle sector? (!(terrainIntersectASL [_zPos, _eye]) // no terrain between? - AND {(!(lineIntersects [_zPos, _eye]))}) // and no object between? + && {(!(lineIntersects [_zPos, _eye]))}) // && no object between? )}) then { _isok = false; }; }; }; if (!_isok) exitWith {false}; - } forEach playableUnits; + } count playableUnits; _isok }; -if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { +if ((dayz_spawnZombies < _maxControlledZombies) && (dayz_CurrentNearByZombies < dayz_maxNearByZombies) && (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { if ([_position, dayz_cantseefov, 10, dayz_cantseeDist] call _cantSee) then { //Check if anyone close _tooClose = {isPlayer _x} count (_position nearEntities ["CAManBase",30]) > 0; @@ -91,7 +91,7 @@ if ((dayz_spawnZombies < _maxControlledZombies) and (dayz_CurrentNearByZombies < _array = []; { _array set [count _array, _x select 0] - } foreach getArray (configFile >> "cfgLoot" >> getText(_lootType)); + } count getArray (configFile >> "cfgLoot" >> getText(_lootType)); if (count _array > 0) then { _index = dayz_CLBase find getText(_lootType); _weights = dayz_CLChances select _index; diff --git a/SQF/dayz_code/external/DRN_ReadMe.txt b/SQF/dayz_code/external/DRN_ReadMe.txt index 882f08604..bd20994cc 100644 --- a/SQF/dayz_code/external/DRN_ReadMe.txt +++ b/SQF/dayz_code/external/DRN_ReadMe.txt @@ -2,26 +2,26 @@ DynamicWeatherEffects v2.00 by Engima of Östgöta Ops ====================================================== -As a mission designer I have always had problems with the weather. It has not been dynamic the way I want it to be, and I've always thought that it synchronizes terribly in multiplayer as soon I start experimenting with it (especially rain). +As a mission designer I have always had problems with the weather. It has not been dynamic the way I want it to be, && I've always thought that it synchronizes terribly in multiplayer as soon I start experimenting with it (especially rain). -This is a simple script that makes the weather dynamic, and it works in single player, multiplayer (hosted and dedicated) and for JIPs. The weather is constantly changing over time intervals of the mission designer's choice. Weather is unpredictable and always synchronized among all players in a multiplayer game! +This is a simple script that makes the weather dynamic, && it works in single player, multiplayer (hosted && dedicated) && for JIPs. The weather is constantly changing over time intervals of the mission designer's choice. Weather is unpredictable && always synchronized among all players in a multiplayer game! -Script handles fog, overcast, rain and wind. +Script handles fog, overcast, rain && wind. ======================= TECHNICAL INFORMATION ======================= -Data sent over network (using publicVariable) is minimal, as data is only sent when weather "forecast" changes and when weather needs to be synchronized because of a JIP player. +Data sent over network (using publicVariable) is minimal, as data is only sent when weather "forecast" changes && when weather needs to be synchronized because of a JIP player. -Fog and overcast is divided into four levels (clear, some, more, heavy) each representing a smaller value interval, since I don't regard pure random values as especially realistic (e.g. there would very seldom be a clear day). These levels are then chosen randomly, but they are forced to change. So If the weather is heavy fog, it will not change to heavy fog again, but to *another* randomly chosen fog level. +Fog && overcast is divided into four levels (clear, some, more, heavy) each representing a smaller value interval, since I don't regard pure random values as especially realistic (e.g. there would very seldom be a clear day). These levels are then chosen randomly, but they are forced to change. So If the weather is heavy fog, it will not change to heavy fog again, but to *another* randomly chosen fog level. -Each client runs a "rain loop" that sets the rain value every third second. This is a workaround for the "rain bug" (or what it is) causing rain to behave randomly on all clients when left unwatched. +Each client runs a "rain loop" that sets the rain value every third second. This is a workaround for the "rain bug" (|| what it is) causing rain to behave randomly on all clients when left unwatched. If overcast goes above 0.75, there is chance of rain, otherwise it cannot rain (limitation in the game). -Fog and overcast does not change at the same time (limitation in game). +Fog && overcast does not change at the same time (limitation in game). ============== @@ -29,7 +29,7 @@ Fog and overcast does not change at the same time (limitation in game). ============== v2.00 -- Added section for mission makers to customize and tweak weather behaviour and details. +- Added section for mission makers to customize && tweak weather behaviour && details. - Dependency to CommonLib.sqf deleted. - Improved rain behaviour. - Initial weather is passed as arguments. @@ -49,7 +49,7 @@ No requirements. INSTALLATION ============== -1. Copy the folder "Scripts" to your mission folder, or just make sure that the following file (and path) exists in your mission folder: +1. Copy the folder "Scripts" to your mission folder, || just make sure that the following file (&& path) exists in your mission folder: Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf @@ -66,54 +66,54 @@ execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; In the script file (DynamicWeatherEffects.sqf) there is a section allowing mission designers to tweak some details regarding weather behavior. The following variables can be altered: -// Minimum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to 1 and less than or equal to _maxWeatherChangeTimeMin. When weather changes, it is fog OR overcast that changes, not both at the same time. (Suggested value: 10). +// Minimum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to 1 && less than || equal to _maxWeatherChangeTimeMin. When weather changes, it is fog || overcast that changes, not both at the same time. (Suggested value: 10). _minWeatherChangeTimeMin = 10; -// Maximum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to _minWeatherChangeTimeMin. (Suggested value: 20). +// Maximum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 20). _maxWeatherChangeTimeMin = 20; -// Minimum time in minutes that weather (fog and overcast) stays constant between weather changes. Must be less than or equal to 0 and greater than or equal to _minWeatherChangeTimeMin. (Suggested value: 5). +// Minimum time in minutes that weather (fog && overcast) stays constant between weather changes. Must be less than || equal to 0 && greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 5). _minTimeBetweenWeatherChangesMin = 5; -// Maximum time in minutes that weather (fog and overcast) stays unchanged between weather changes. Must be greater than or equal to _minWeatherChangeTimeMin. (Suggested value: 10). +// Maximum time in minutes that weather (fog && overcast) stays unchanged between weather changes. Must be greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 10). _maxTimeBetweenWeatherChangesMin = 10; -// Fog intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumFog (0 = no fog, 1 = pea soup). (Suggested value: 0). +// Fog intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumFog (0 = no fog, 1 = pea soup). (Suggested value: 0). _minimumFog = 0; -// Fog intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumFog (0 = no fog, 1 = pea soup). (Suggested value: 0.8). +// Fog intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumFog (0 = no fog, 1 = pea soup). (Suggested value: 0.8). _maximumFog = 0.8; -// Overcast intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 0). +// Overcast intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 0). _minimumOvercast = 0; -// Overcast intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 1). +// Overcast intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumOvercast (0 = no overcast, 1 = maximum overcast). (Suggested value: 1). _maximumOvercast = 1; -// When raining, rain intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0); +// When raining, rain intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0); _minimumRain = 0; -// When raining, rain intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8); +// When raining, rain intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumRain (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8); _maximumRain = 0.8; -// Wind vector strength never falls below this value. Must be greater or equal to 0 and less than or equal to _maximumWind. (Suggested value: 0); +// Wind vector strength never falls below this value. Must be greater || equal to 0 && less than || equal to _maximumWind. (Suggested value: 0); _minimumWind = 0; -// Wind vector strength never exceeds this value. Must be greater or equal to 0 and greater than or equal to _minimumWind. (Suggested value: 8). +// Wind vector strength never exceeds this value. Must be greater || equal to 0 && greater than || equal to _minimumWind. (Suggested value: 8). _maximumWind = 8; -// Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will change every time the weather (fog or overcast) start to change. (Suggested value: 25); +// Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will change every time the weather (fog || overcast) start to change. (Suggested value: 25); _windChangeProbability = 25; -// A "rain interval" is defined as "a time interval during which it may rain in any intensity (or it may not rain at all)". When overcast goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast below 0.75 rain intervals never execute (thus it cannot rain). +// A "rain interval" is defined as "a time interval during which it may rain in any intensity (|| it may not rain at all)". When overcast goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast below 0.75 rain intervals never execute (thus it cannot rain). -// Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100 if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then lower this value and vice versa. (Suggested value: 50). +// Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100 if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then lower this value && vice versa. (Suggested value: 50). _rainIntervalRainProbability = 50; -// Minimum time in minutes for rain intervals. Must be greater or equal to 0 and less than or equal to _maxRainIntervalTimeMin. (Suggested value: 0). +// Minimum time in minutes for rain intervals. Must be greater || equal to 0 && less than || equal to _maxRainIntervalTimeMin. (Suggested value: 0). _minRainIntervalTimeMin = 0; -// Maximum time in minutes for rain intervals. Must be greater than or equal to _minRainIntervalTimeMin. (Suggested value: (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2)). +// Maximum time in minutes for rain intervals. Must be greater than || equal to _minRainIntervalTimeMin. (Suggested value: (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2)). _maxRainIntervalTimeMin = (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2; // If set to true, then the rain is forced to stop after one rain interval during which it has rained (use this for example if you only want small occational cloudbursts). If set to false, then the rain may stop, but it may also just change intensity for an immedeate new rain interval. (Suggested value: false). @@ -126,10 +126,10 @@ _forceRainToStopAfterOneRainInterval = false; Arguments can be passed to the script to set initial mission weather. The following five arguments can be passed to the script: -1) [_initialFog]: Optional. Fog when mission starts. Must be between 0 and 1 where 0 = no fog, 1 = maximum fog. -1 = random fog. -2) [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 and 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast. -3) [_initialRain]: Optional. Rain when mission starts. Must be between 0 and 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than or equal to 0.75). -4) [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector and z is the other. x and z must be greater than or equal to 0. [-1, -1] = random wind. +1) [_initialFog]: Optional. Fog when mission starts. Must be between 0 && 1 where 0 = no fog, 1 = maximum fog. -1 = random fog. +2) [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 && 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast. +3) [_initialRain]: Optional. Rain when mission starts. Must be between 0 && 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than || equal to 0.75). +4) [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector && z is the other. x && z must be greater than || equal to 0. [-1, -1] = random wind. 5) [_debug]: Optional. true if debug text is to be shown, otherwise false. @@ -137,19 +137,19 @@ Arguments can be passed to the script to set initial mission weather. The follow EXAMPLES ============== -Only one line is needed in init.sqf, and here are some examples: +Only one line is needed in init.sqf, && here are some examples: // The mission will start with random weather. execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; -// The mission will start with fog set to 0.5, but overcast, rain and wind will be random. +// The mission will start with fog set to 0.5, but overcast, rain && wind will be random. [0.5] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; -// The mission will start with fog set to 0.1, overcast set to 0.9, rain set to 1, and wind will be random. +// The mission will start with fog set to 0.1, overcast set to 0.9, rain set to 1, && wind will be random. [0.1, 0.9, 1] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; -// The mission will start with random fog, random overcast, random rain and no wind. Debug messages will be displayed for all players. +// The mission will start with random fog, random overcast, random rain && no wind. Debug messages will be displayed for all players. [-1, -1, -1, [0, 0], true] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; -// The mission will start with fog set to 0.5, overcast set to 0.5, no rain (since the overcast is less than 0.75), and strong wind in direction south west. +// The mission will start with fog set to 0.5, overcast set to 0.5, no rain (since the overcast is less than 0.75), && strong wind in direction south west. [0.5, 0.5, 0.5, [10, 10]] execVM "Scripts\DRN\DynamicWeatherEffects\DynamicWeatherEffects.sqf"; diff --git a/SQF/dayz_code/external/DynamicWeatherEffects.sqf b/SQF/dayz_code/external/DynamicWeatherEffects.sqf index 2dd5ea523..77d766582 100644 --- a/SQF/dayz_code/external/DynamicWeatherEffects.sqf +++ b/SQF/dayz_code/external/DynamicWeatherEffects.sqf @@ -1,11 +1,11 @@ /* DynamicWeatherEffects.sqf version 1.01 by Engima of Ostgota Ops * Description: - * Script that generates dynamic (random) weather. Works in single player, multiplayer (hosted and dedicated), and is JIP compatible. + * Script that generates dynamic (random) weather. Works in single player, multiplayer (hosted && dedicated), && is JIP compatible. * Arguments: - * [_initialFog]: Optional. Fog when mission starts. Must be between 0 and 1 where 0 = no fog, 1 = maximum fog. -1 = random fog. - * [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 and 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast. - * [_initialRain]: Optional. Rain when mission starts. Must be between 0 and 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than or equal to 0.75). - * [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector and z is the other. x and z must be greater than or equal to 0. [-1, -1] = random wind. + * [_initialFog]: Optional. Fog when mission starts. Must be between 0 && 1 where 0 = no fog, 1 = maximum fog. -1 = random fog. + * [_initialOvercast]: Optional. Overcast when mission starts. Must be between 0 && 1 where 0 = no overcast, 1 = maximum overcast. -1 = random overcast. + * [_initialRain]: Optional. Rain when mission starts. Must be between 0 && 1 where 0 = no rain, 1 = maximum rain. -1 = random rain. (Overcast must be greater than || equal to 0.75). + * [_initialWind]: Optional. Wind when mission starts. Must be an array of form [x, z], where x is one wind strength vector && z is the other. x && z must be greater than || equal to 0. [-1, -1] = random wind. * [_debug]: Optional. true if debug text is to be shown, otherwise false. */ @@ -23,72 +23,72 @@ if (count _this > 4) then { _debug = _this select 4; } else { _debug = false; }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // The following variables can be changed to tweak weather behaviour -// Minimum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to 1 and less than or equal to -// _maxWeatherChangeTimeMin. When weather changes, it is fog OR overcast that changes, not both at the same time. (Suggested value: 10). +// Minimum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to 1 && less than || equal to +// _maxWeatherChangeTimeMin. When weather changes, it is fog || overcast that changes, not both at the same time. (Suggested value: 10). _minWeatherChangeTimeMin = 10; -// Maximum time in minutes for the weather (fog and overcast) to change. Must be greater than or equal to _minWeatherChangeTimeMin. +// Maximum time in minutes for the weather (fog && overcast) to change. Must be greater than || equal to _minWeatherChangeTimeMin. // (Suggested value: 20). _maxWeatherChangeTimeMin = 20; -// Minimum time in minutes that weather (fog and overcast) stays constant between weather changes. Must be less than or equal to 0 and -// greater than or equal to _minWeatherChangeTimeMin. (Suggested value: 5). +// Minimum time in minutes that weather (fog && overcast) stays constant between weather changes. Must be less than || equal to 0 && +// greater than || equal to _minWeatherChangeTimeMin. (Suggested value: 5). _minTimeBetweenWeatherChangesMin = 5; -// Maximum time in minutes that weather (fog and overcast) stays unchanged between weather changes. Must be greater than or equal to +// Maximum time in minutes that weather (fog && overcast) stays unchanged between weather changes. Must be greater than || equal to // _minWeatherChangeTimeMin. (Suggested value: 10). _maxTimeBetweenWeatherChangesMin = 10; -// Fog intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumFog +// Fog intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumFog // (0 = no fog, 1 = pea soup). (Suggested value: 0). _minimumFog = 0; -// Fog intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumFog +// Fog intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumFog // (0 = no fog, 1 = pea soup). (Suggested value: 0.8). _maximumFog = 0.5; -// Overcast intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumOvercast +// Overcast intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumOvercast // (0 = no overcast, 1 = maximum overcast). (Suggested value: 0). _minimumOvercast = 0; -// Overcast intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumOvercast +// Overcast intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumOvercast // (0 = no overcast, 1 = maximum overcast). (Suggested value: 1). _maximumOvercast = 1; -// When raining, rain intensity never falls below this value. Must be between 0 and 1 and less than or equal to _maximumRain +// When raining, rain intensity never falls below this value. Must be between 0 && 1 && less than || equal to _maximumRain // (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0); _minimumRain = 0; -// When raining, rain intensity never exceeds this value. Must be between 0 and 1 and greater than or equal to _minimumRain +// When raining, rain intensity never exceeds this value. Must be between 0 && 1 && greater than || equal to _minimumRain // (0 = no rain, 1 = maximum rain intensity). (Suggested value: 0.8); _maximumRain = 0.8; -// Wind vector strength never falls below this value. Must be greater or equal to 0 and less than or equal to _maximumWind. +// Wind vector strength never falls below this value. Must be greater || equal to 0 && less than || equal to _maximumWind. // (Suggested value: 0); _minimumWind = 0; -// Wind vector strength never exceeds this value. Must be greater or equal to 0 and greater than or equal to _minimumWind. +// Wind vector strength never exceeds this value. Must be greater || equal to 0 && greater than || equal to _minimumWind. // (Suggested value: 8). _maximumWind = 8; // Probability in percent for wind to change when weather changes. If set to 0 then wind will never change. If set to 100 then rain will -// change every time the weather (fog or overcast) start to change. (Suggested value: 25); +// change every time the weather (fog || overcast) start to change. (Suggested value: 25); _windChangeProbability = 25; -// A "rain interval" is defined as "a time interval during which it may rain in any intensity (or it may not rain at all)". When overcast +// A "rain interval" is defined as "a time interval during which it may rain in any intensity (|| it may not rain at all)". When overcast // goes above 0.75, a chain of rain intervals (defined below) is started. It cycles on until overcast falls below 0.75. At overcast // below 0.75 rain intervals never execute (thus it cannot rain). // Probability in percent (0-100) for rain to start at every rain interval. Set this to 0 if you don't want rain at all. Set this to 100 // if you want it to rain constantly when overcast is greater than 0.75. In short: if you think that it generally rains to often then -// lower this value and vice versa. (Suggested value: 50). +// lower this value && vice versa. (Suggested value: 50). _rainIntervalRainProbability = 50; -// Minimum time in minutes for rain intervals. Must be greater or equal to 0 and less than or equal to _maxRainIntervalTimeMin. +// Minimum time in minutes for rain intervals. Must be greater || equal to 0 && less than || equal to _maxRainIntervalTimeMin. // (Suggested value: 0). _minRainIntervalTimeMin = 0; -// Maximum time in minutes for rain intervals. Must be greater than or equal to _minRainIntervalTimeMin. (Suggested value: +// Maximum time in minutes for rain intervals. Must be greater than || equal to _minRainIntervalTimeMin. (Suggested value: // (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2). _maxRainIntervalTimeMin = (_maxWeatherChangeTimeMin + _maxTimeBetweenWeatherChangesMin) / 2; @@ -139,7 +139,7 @@ if (_debug) then { ["Starting script WeatherEffects.sqf..."] call drn_fnc_DynamicWeather_ShowDebugTextLocal; }; -drn_DynamicWeatherEventArgs = []; // [current overcast, current fog, current rain, current weather change ("OVERCAST", "FOG" or ""), target weather value, time until weather completion (in seconds), current wind x, current wind z] +drn_DynamicWeatherEventArgs = []; // [current overcast, current fog, current rain, current weather change ("OVERCAST", "FOG" || ""), target weather value, time until weather completion (in seconds), current wind x, current wind z] drn_AskServerDynamicWeatherEventArgs = []; // [] drn_fnc_DynamicWeather_SetWeatherLocal = { @@ -468,7 +468,7 @@ if (isServer) then { if (time >= _nextRainEventTime) then { private ["_rainTimeSec"]; - // At every rain event time, start or stop rain with 50% probability + // At every rain event time, start || stop rain with 50% probability if (random 100 < _rainIntervalRainProbability && !_forceStop) then { drn_var_DynamicWeather_rain = _minimumRain + random (_maximumRain - _minimumRain); publicVariable "drn_var_DynamicWeather_rain"; diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf index d0f794af7..ae39d2ea3 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Tired/R3F_DoTired.sqf @@ -88,7 +88,7 @@ while {true} do { [_level] call R3F_TIRED_FNCT_Voile_Noir; - if (R3F_TIRED_Accumulator > R3F_TIRED_BLACKOUT_LEVEL and scriptDone R3F_TIRED_Handle_Blackout_Effect and scriptDone R3F_TIRED_Handle_Blur_Effect) then { + if (R3F_TIRED_Accumulator > R3F_TIRED_BLACKOUT_LEVEL && scriptDone R3F_TIRED_Handle_Blackout_Effect && scriptDone R3F_TIRED_Handle_Blur_Effect) then { R3F_TIRED_Handle_Blackout_Effect = [] spawn R3F_TIRED_FNCT_DoBlackVanish; }; } else { diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_WEIGHT_Configuration.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_WEIGHT_Configuration.sqf index 617cc8ad0..58ce90b7a 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_WEIGHT_Configuration.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_WEIGHT_Configuration.sqf @@ -18,5 +18,5 @@ along with this program. If not, see . #define R3F_WEIGHT_SHOW_WEIGHT -//show or not classes not found in arma.rpt +//show || not classes not found in arma.rpt //#define R3F_WEIGHT_SHOW_CLASSES_NOT_FOUND \ No newline at end of file diff --git a/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_Weight_Fnct.sqf b/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_Weight_Fnct.sqf index 9127453d0..b947741c3 100644 --- a/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_Weight_Fnct.sqf +++ b/SQF/dayz_code/external/R3F_Realism/R3F_Weight/R3F_Weight_Fnct.sqf @@ -23,7 +23,7 @@ R3F_WEIGHT_FNCT_MakeSingleArray = { }; _n = _n + 1; - }foreach _arr_i; + }count _arr_i; _arr; }; @@ -57,7 +57,7 @@ R3F_WEIGHT_FNCT_GetItemWeight = { }; }; }; - }foreach _arr_class; + }count _arr_class; _total_weight; }; diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf index 7aa780683..9a8373cbe 100644 --- a/SQF/dayz_code/init/compiles.sqf +++ b/SQF/dayz_code/init/compiles.sqf @@ -21,7 +21,7 @@ if (!isDedicated) then { building_spawnLoot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnLoot.sqf"; building_spawnZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\building_spawnZombies.sqf"; dayz_spaceInterrupt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf"; - player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre and audial rating + player_fired = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_fired.sqf"; //Runs when player fires. Alerts nearby Zeds depending on calibre && audial rating player_harvest = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_harvest.sqf"; player_packTent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packTent.sqf"; player_packVault = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_packVault.sqf"; @@ -127,10 +127,10 @@ if (!isDedicated) then { player_hasTools = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_hasTools.sqf"; player_checkItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_checkItems.sqf"; player_removeItems = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_removeItems.sqf"; - //Trader ["Trader City Name",false,"enter"] - Trader City Name | Show Message | "enter" or "leave" + //Trader ["Trader City Name",false,"enter"] - Trader City Name | Show Message | "enter" || "leave" player_traderCity = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_traderCity.sqf"; - // combination of check and remove items + // combination of check && remove items player_checkAndRemoveItems = { private ["_items","_b"]; _items = _this; @@ -155,7 +155,7 @@ if (!isDedicated) then { if isNumber (_worth) then { _total_currency = _total_currency + getNumber(_worth); }; - } forEach (magazines player); + } count (magazines player); _total_currency }; @@ -169,7 +169,7 @@ if (!isDedicated) then { _trade_total = _trade_total + (getNumber(_part_inWorth) * (_x select 1)); }; }; - } forEach _this; + } count _this; //diag_log format["DEBUG TRADER ITEMCOST: %1", _this]; _trade_total @@ -201,7 +201,7 @@ if (!isDedicated) then { _ctrlBleed = _display displayCtrl 1303; _ctrlBleed ctrlShow false; }; - if (!r_fracture_legs and !r_fracture_arms) then { + if (!r_fracture_legs && !r_fracture_arms) then { _ctrlFracture = _display displayCtrl 1203; _ctrlFracture ctrlShow false; }; @@ -229,7 +229,7 @@ if (!isDedicated) then { _tPos set [2,(_tPos select 2)+1]; _zPos set [2,(_zPos select 2)+1]; - if ((count _tPos > 0) and (count _zPos > 0)) then { + if ((count _tPos > 0) && (count _zPos > 0)) then { _cantSee = terrainIntersectASL [_tPos, _zPos]; if (!_cantSee) then { _cantSee = lineIntersects [_tPos, _zPos, _agent, vehicle _target]; @@ -249,7 +249,7 @@ if (!isDedicated) then { _success = true; { if (_x > 0) then {_success = false}; - } forEach _diff; + } count _diff; hint format["Config: %5\nEmpty: %1\nNeeded: %2\nDiff: %3\nSuccess: %4",_empty,_needed,_diff,_success,_config]; _success }; @@ -259,7 +259,7 @@ if (!isDedicated) then { _counter = 0; { _counter = _counter + _x; - } forEach _this; + } count _this; _counter }; @@ -378,7 +378,7 @@ if (!isDedicated) then { { if (58 == _objInfo select _i) exitWith {}; _i = _i + 1; - } forEach _objInfo; + } count _objInfo; _i = _i + 2; // skip the ": " part for "_k" from _i to _lenInfo do { _objName set [(count _objName), (_objInfo select _k)]; @@ -398,7 +398,7 @@ if (!isDedicated) then { _playerDistance = player distance _this; { if (_playerDistance > (_x distance _this)) exitWith { _notClosest = true; }; - } forEach _nearPlayers; + } count _nearPlayers; }; } else { _notClosest = false; @@ -493,9 +493,9 @@ if (!isDedicated) then { object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles) object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles) - object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records and sets hit) + object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records && sets hit) object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf"; - // object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents + // object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player || server to monitor changes in cargo contents fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle // Vehicle damage fix @@ -508,12 +508,12 @@ if (!isDedicated) then { fnc_isInsideBuilding3 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding3.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding3; dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf"; - local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object + local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (|| local to unit) when gutting an object local_lockUnlock = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf"; //When vehicle is local to unit perform locking vehicle - local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object + local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (|| local to unit) when gutting an object local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed - //player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon + //player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player || server to monitor whether they have picked up a new weapon curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf"; player_medBandage = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; player_medInject = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medInject.sqf"; @@ -522,7 +522,7 @@ if (!isDedicated) then { player_medMorphine = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; player_breaklegs = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medBreakLegs.sqf"; player_medPainkiller = compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf"; - world_isDay = {if ((daytime < (24 - dayz_sunRise)) and (daytime > dayz_sunRise)) then {true} else {false}}; + world_isDay = {if ((daytime < (24 - dayz_sunRise)) && (daytime > dayz_sunRise)) then {true} else {false}}; player_humanityChange = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_humanityChange.sqf"; spawn_loot = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot.sqf"; spawn_loot_small = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\spawn_loot_small.sqf"; @@ -579,7 +579,7 @@ if (!isDedicated) then { _space = floor((_slotsEmpty select _c) / _x); }; _c = _c + 1; - } forEach _slotsItem; + } count _slotsItem; _space }; @@ -590,7 +590,7 @@ if (!isDedicated) then { _inVehicle = (_vehicle != player); if(_inVehicle) then { _noDriver = ((_vehicle emptyPositions "driver") > 0); - if (_noDriver and (speed _vehicle) != 0) then { + if (_noDriver && (speed _vehicle) != 0) then { player action [ "eject", _vehicle]; }; }; @@ -605,7 +605,7 @@ if (!isDedicated) then { if (_character getVariable[_x,false]) then { _wounds set [count _wounds,_x]; }; - } forEach USEC_typeOfWounds; + } count USEC_typeOfWounds; }; _legs = _character getVariable ["hit_legs",0]; _arms = _character getVariable ["hit_arms",0]; diff --git a/SQF/dayz_code/init/object_pickupAction.sqf b/SQF/dayz_code/init/object_pickupAction.sqf index 513e21768..34c760bb0 100644 --- a/SQF/dayz_code/init/object_pickupAction.sqf +++ b/SQF/dayz_code/init/object_pickupAction.sqf @@ -24,18 +24,18 @@ actionMonitor = { if (alive _holder) then { _distance = player distance _holder; // Add action to player - if ((_distance < 1.75) and (_action == -1)) then { + if ((_distance < 1.75) && (_action == -1)) then { _action = player addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true]; player reveal _holder; _timeout = 0.3; }; // Remove action from player - if ((_distance >= 1.75) and (_action != -1)) then { + if ((_distance >= 1.75) && (_action != -1)) then { player removeAction _action; _action = -1; _timeout = 2; }; - // Stop the loop and fall back to old code + // Stop the loop && fall back to old code if (_distance > 100) then { _null = _holder addAction [format[(localize "STR_DAYZ_CODE_1"),_name], "\z\addons\dayz_code\actions\object_pickup.sqf",[_type,_classname,_holder], 20, true, true]; player reveal _holder; diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf index c022bc17a..c30179ba4 100644 --- a/SQF/dayz_code/init/publicEH.sqf +++ b/SQF/dayz_code/init/publicEH.sqf @@ -57,7 +57,7 @@ if (isServer) then { "PVDZE_plr_LoginRecord" addPublicVariableEventHandler {_id = (_this select 1) spawn dayz_recordLogin}; //Checking "PVDZE_obj_Delete" addPublicVariableEventHandler {(_this select 1) spawn server_deleteObj}; - // upgrade and maintain + // upgrade && maintain "PVDZE_obj_Swap" addPublicVariableEventHandler {(_this select 1) spawn server_swapObject}; // disable zombies server side "PVDZE_zed_Spawn" addPublicVariableEventHandler {(_this select 1) spawn server_handleZedSpawn}; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 049ef04ee..2da561d69 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -309,7 +309,7 @@ r_player_removeActions2 = { if (!isNull r_player_lastVehicle) then { { r_player_lastVehicle removeAction _x; - } forEach r_player_actions2; + } count r_player_actions2; r_player_actions2 = []; r_action2 = false; }; @@ -431,9 +431,9 @@ DAYZ_agentnumber = 0; dayz_animalDistance = 800; dayz_zSpawnDistance = 1000; -dayz_maxMaxModels = 80; // max quantity of Man models (player or Z, dead or alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot +dayz_maxMaxModels = 80; // max quantity of Man models (player || Z, dead || alive) around players. Below this limit we can spawn Z // max quantity of loot piles around players. Below this limit we can spawn some loot dayz_spawnArea = 200; // radius around player where we can spawn loot & Z -dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing and angle checks +dayz_cantseeDist = 150; // distance from which we can spawn a Z in front of any player without ray-tracing && angle checks dayz_cantseefov = 70; // half player field-of-view. Visible Z won't be spawned in front of any near players dayz_canDelete = 300; // Z, further than this distance from its "owner", will be deleted selfTransfusionTime = time; //time to keep for last self transfusion. diff --git a/SQF/dayz_code/medical/bandage.sqf b/SQF/dayz_code/medical/bandage.sqf index a876b532c..c5c10c7b9 100644 --- a/SQF/dayz_code/medical/bandage.sqf +++ b/SQF/dayz_code/medical/bandage.sqf @@ -28,7 +28,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -54,7 +54,7 @@ if (_finished) then { _display closeDisplay 0; }; - if ((_unit == player) or (vehicle player != player)) then { + if ((_unit == player) || (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; dayz_sourceBleeding = objNull; @@ -65,7 +65,7 @@ if (_finished) then { [player,20] call player_humanityChange; }; - {_unit setVariable[_x,false,true];} forEach USEC_woundHit; + {_unit setVariable[_x,false,true];} count USEC_woundHit; _unit setVariable ["USEC_injured",false,true]; }; diff --git a/SQF/dayz_code/medical/init_medical.sqf b/SQF/dayz_code/medical/init_medical.sqf index 7a70e9d41..6074d2929 100644 --- a/SQF/dayz_code/medical/init_medical.sqf +++ b/SQF/dayz_code/medical/init_medical.sqf @@ -3,7 +3,7 @@ // Functions -// Added pvEH - scripts modified to remove the need for sending long strings via setVehicleInit to reduce network traffic and JIP load - 04072010 +// Added pvEH - scripts modified to remove the need for sending long strings via setVehicleInit to reduce network traffic && JIP load - 04072010 // INCLUDE REQUIRED GAME CODES #include "\ca\editor\Data\Scripts\dikCodes.h" @@ -32,7 +32,7 @@ while {true} do { _id = [dayz_sourceBleeding,"bled"] spawn player_death; }; - if ((r_player_blood <= 3000) and !r_player_unconscious) then { + if ((r_player_blood <= 3000) && !r_player_unconscious) then { _rnd = random 100; if (_rnd > 99) then { [player,((random 0.1) + 0.2)] call fnc_usec_damageUnconscious; @@ -40,13 +40,13 @@ while {true} do { }; //Handle Unconscious player - if ((r_player_unconscious) and (!r_player_handler1)) then { + if ((r_player_unconscious) && (!r_player_handler1)) then { //localize "CLIENT: Start Unconscious Function"; [] spawn fnc_usec_unconscious; }; //Handle player bleeding - if ((r_player_injured) and (!r_player_handler)) then { + if ((r_player_injured) && (!r_player_handler)) then { r_player_handler = true; sleep 1; //localize "CLIENT: Start Player Bleeding"; @@ -55,7 +55,7 @@ while {true} do { }; //Handle player infection - if ((r_player_infected) and (!r_player_handler)) then { + if ((r_player_infected) && (!r_player_handler)) then { r_player_handler = true; sleep 1; [] spawn fnc_med_publicBlood; @@ -81,7 +81,7 @@ while {true} do { }; sleep 0.5; _lowBlood = player getVariable ["USEC_lowBlood", false]; - if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then { + if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then { player setVariable["USEC_lowBlood",true,true]; }; }; diff --git a/SQF/dayz_code/medical/morphine.sqf b/SQF/dayz_code/medical/morphine.sqf index 1ffd78629..939c3d8c1 100644 --- a/SQF/dayz_code/medical/morphine.sqf +++ b/SQF/dayz_code/medical/morphine.sqf @@ -27,7 +27,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; @@ -52,7 +52,7 @@ if (_finished) then { _display closeDisplay 0; }; - if ((_unit == player) or (vehicle player != player)) then { + if ((_unit == player) || (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf"; } else { diff --git a/SQF/dayz_code/medical/painkiller.sqf b/SQF/dayz_code/medical/painkiller.sqf index fde75adaf..28f09ba05 100644 --- a/SQF/dayz_code/medical/painkiller.sqf +++ b/SQF/dayz_code/medical/painkiller.sqf @@ -24,7 +24,7 @@ if(_num_removed == 1) then { player playActionNow "Gear"; }; - if ((_unit == player) or (vehicle player != player)) then { + if ((_unit == player) || (vehicle player != player)) then { //Self Healing _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf"; } else { diff --git a/SQF/dayz_code/medical/publicEH/animHealed.sqf b/SQF/dayz_code/medical/publicEH/animHealed.sqf index 7513b5564..b8f76183a 100644 --- a/SQF/dayz_code/medical/publicEH/animHealed.sqf +++ b/SQF/dayz_code/medical/publicEH/animHealed.sqf @@ -4,7 +4,7 @@ private ["_unit"]; _unit = _this select 0; _unit switchMove "AmovPpneMstpSnonWnonDnon_healed"; -if ((_unit == player) or (vehicle player != player)) then { +if ((_unit == player) || (vehicle player != player)) then { r_player_unconscious = false; r_player_injured = false; }; \ No newline at end of file diff --git a/SQF/dayz_code/medical/publicEH/medBandaged.sqf b/SQF/dayz_code/medical/publicEH/medBandaged.sqf index 183daf338..1db59f763 100644 --- a/SQF/dayz_code/medical/publicEH/medBandaged.sqf +++ b/SQF/dayz_code/medical/publicEH/medBandaged.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if ((_unit == player) or (vehicle player != player)) then { +if ((_unit == player) || (vehicle player != player)) then { r_player_injured = false; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; r_player_handler = false; diff --git a/SQF/dayz_code/medical/publicEH/medMorphine.sqf b/SQF/dayz_code/medical/publicEH/medMorphine.sqf index cb5d18d52..13016cb7b 100644 --- a/SQF/dayz_code/medical/publicEH/medMorphine.sqf +++ b/SQF/dayz_code/medical/publicEH/medMorphine.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if ((_unit == player) or (vehicle player != player)) then { +if ((_unit == player) || (vehicle player != player)) then { r_fracture_legs = false; r_fracture_arms = false; _unit setHit["legs",0]; diff --git a/SQF/dayz_code/medical/publicEH/medPainkiller.sqf b/SQF/dayz_code/medical/publicEH/medPainkiller.sqf index 2422b3c9d..397edcd87 100644 --- a/SQF/dayz_code/medical/publicEH/medPainkiller.sqf +++ b/SQF/dayz_code/medical/publicEH/medPainkiller.sqf @@ -5,7 +5,7 @@ _array = _this; //_this select 0; _unit = _array select 0; _medic = _array select 1; -if ((_unit == player) or (vehicle player != player)) then { +if ((_unit == player) || (vehicle player != player)) then { r_player_inpain = false; R3F_TIRED_Accumulator = 0; "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5; diff --git a/SQF/dayz_code/medical/self_transfusion.sqf b/SQF/dayz_code/medical/self_transfusion.sqf index b573e8075..953a9ff33 100644 --- a/SQF/dayz_code/medical/self_transfusion.sqf +++ b/SQF/dayz_code/medical/self_transfusion.sqf @@ -23,7 +23,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/medical/setup_functions_med.sqf b/SQF/dayz_code/medical/setup_functions_med.sqf index 7a30ec4f0..493cbfc9c 100644 --- a/SQF/dayz_code/medical/setup_functions_med.sqf +++ b/SQF/dayz_code/medical/setup_functions_med.sqf @@ -39,7 +39,7 @@ fnc_usec_damageUnconscious = { _unit = _this select 0; _damage = _this select 1; _inVehicle = (vehicle _unit != _unit); - if ((_unit == player) or (vehicle player != player)) then { + if ((_unit == player) || (vehicle player != player)) then { r_player_timeout = round((((random 2) max 0.1) * _damage) * 20); r_player_unconscious = true; player setVariable["medForceUpdate",true,true]; @@ -50,7 +50,7 @@ fnc_usec_damageUnconscious = { private["_veh","_unit"]; _veh = vehicle _this; _unit = _this; - waitUntil{(((([_veh] call FNC_GetPos) select 2 < 1) and (speed _veh < 1)) or (!r_player_unconscious))}; + waitUntil{(((([_veh] call FNC_GetPos) select 2 < 1) && (speed _veh < 1)) || (!r_player_unconscious))}; if (r_player_unconscious) then { _unit action ["eject", _veh]; waitUntil{((vehicle _this) != _this)}; @@ -84,10 +84,10 @@ fnc_usec_damageType = { _damage = _this select 0; _ammo = _this select 1; _type = 0; - if ((_ammo isKindof "Grenade") or (_ammo isKindof "ShellBase") or (_ammo isKindof "TimeBombCore") or (_ammo isKindof "BombCore") or (_ammo isKindof "MissileCore") or (_ammo isKindof "RocketCore") or (_ammo isKindof "FuelExplosion") or (_ammo isKindof "GrenadeBase")) then { + if ((_ammo isKindof "Grenade") || (_ammo isKindof "ShellBase") || (_ammo isKindof "TimeBombCore") || (_ammo isKindof "BombCore") || (_ammo isKindof "MissileCore") || (_ammo isKindof "RocketCore") || (_ammo isKindof "FuelExplosion") || (_ammo isKindof "GrenadeBase")) then { _type = 1; }; - if ((_ammo isKindof "B_127x107_Ball") or (_ammo isKindof "B_127x99_Ball")) then { + if ((_ammo isKindof "B_127x107_Ball") || (_ammo isKindof "B_127x99_Ball")) then { _type = 2; }; if (_ammo isKindof "Melee") then { @@ -115,8 +115,8 @@ fnc_usec_medic_removeActions = { _obj = _x; { _obj removeAction _x; - } forEach r_player_actions; - } forEach r_action_targets; + } count r_player_actions; + } count r_action_targets; r_player_actions = []; r_action_targets = []; }; @@ -124,12 +124,12 @@ fnc_usec_medic_removeActions = { fnc_usec_self_removeActions = { { player removeAction _x; - } forEach r_self_actions; + } count r_self_actions; r_self_actions = []; }; fnc_med_publicBlood = { - while {(r_player_injured or r_player_infected) and r_player_blood > 0} do { + while {(r_player_injured || r_player_infected) && r_player_blood > 0} do { player setVariable["USEC_BloodQty",r_player_blood,true]; player setVariable["medForceUpdate",true]; sleep 5; @@ -146,11 +146,11 @@ fnc_usec_playerBleed = { while {r_player_injured} do { _bleedPerSec = 30; - // If kneeling or crawling reduce bleeding - if (dayz_isKneeling and !r_player_unconscious) then{ + // If kneeling || crawling reduce bleeding + if (dayz_isKneeling && !r_player_unconscious) then{ _bleedPerSec = 15; }; - if (dayz_isCrawling and !r_player_unconscious) then{ + if (dayz_isCrawling && !r_player_unconscious) then{ _bleedPerSec = 7.5; }; @@ -163,7 +163,7 @@ fnc_usec_playerBleed = { r_player_injured = false; _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf"; dayz_sourceBleeding = objNull; - {player setVariable[_x,false,true];} forEach USEC_woundHit; + {player setVariable[_x,false,true];} count USEC_woundHit; player setVariable ["USEC_injured",false,true]; }; sleep 1; @@ -228,7 +228,7 @@ fnc_usec_damageBleed = { sleep 5; - while {((_unit getVariable["USEC_injured",true]) and (alive _unit))} do { + while {((_unit getVariable["USEC_injured",true]) && (alive _unit))} do { scopeName "loop"; if (vehicle _unit != _unit) then { BreakOut "loop"; diff --git a/SQF/dayz_code/medical/transfusion.sqf b/SQF/dayz_code/medical/transfusion.sqf index 56f716d1d..66681dbb1 100644 --- a/SQF/dayz_code/medical/transfusion.sqf +++ b/SQF/dayz_code/medical/transfusion.sqf @@ -29,7 +29,7 @@ while {r_doLoop} do { if (_isMedic) then { _started = true; }; - if (_started and !_isMedic) then { + if (_started && !_isMedic) then { r_doLoop = false; _finished = true; }; diff --git a/SQF/dayz_code/music.fsm b/SQF/dayz_code/music.fsm index fe63d1479..f66eb0937 100644 --- a/SQF/dayz_code/music.fsm +++ b/SQF/dayz_code/music.fsm @@ -124,7 +124,7 @@ class FSM priority = 90.000000; to="wait"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"r_player_unconscious or r_player_dead"/*%FSM*/; + condition=/*%FSM*/"r_player_unconscious || r_player_dead"/*%FSM*/; action=/*%FSM*/"_delay = 20;"/*%FSM*/; }; /*%FSM*/ diff --git a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf index 56c7585ba..ea290c564 100644 --- a/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf +++ b/SQF/dayz_code/system/BIS_Effects/airdestruction.sqf @@ -92,7 +92,7 @@ if (!isDedicated) then { //dw, particle stuff don't need run on dedicated clearvehicleinit _v; deleteVehicle _v; _v =(_wreck) createvehicle _pos; - {_x moveincargo _v} foreach _crw; + {_x moveincargo _v} count _crw; _v setVectorDirAndUp [_dir,_vecUp]; _v setFuel 0; _v setdamage 0; @@ -126,7 +126,7 @@ else clearvehicleinit _v; deleteVehicle _v; _v =(_wreck) createvehicle _pos; - {_x moveincargo _v} foreach _crw; + {_x moveincargo _v} count _crw; //sleep 0.05; _v setvelocity _vel; //_v setPos _pos; diff --git a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf index 974e015c3..fe3f98665 100644 --- a/SQF/dayz_code/system/BIS_Effects/secondaries.sqf +++ b/SQF/dayz_code/system/BIS_Effects/secondaries.sqf @@ -10,7 +10,7 @@ if (count _this > 2) then {_lifecheck=_this select 2}; _int = _int min 3; -if (!((_v isKindOf "Air")OR{((_v isKindOf "LandVehicle")OR{(_v isKindOf "Ship")})})) exitWith {}; +if (!((_v isKindOf "Air")||{((_v isKindOf "LandVehicle")||{(_v isKindOf "Ship")})})) exitWith {}; _effect2pos = _v selectionposition "destructionEffect2"; @@ -24,4 +24,4 @@ while {_int>1} do sleep _x; if((_lifecheck&&(alive _v))||(isnull _v)||(((getposASL _v)select 2)<0))exitwith{}; createVehicle ["SmallSecondary", (_v modelToWorld _effect2pos), [], 0, "CAN_COLLIDE"]; -}foreach(_list); \ No newline at end of file +}count(_list); \ No newline at end of file diff --git a/SQF/dayz_code/system/REsec.sqf b/SQF/dayz_code/system/REsec.sqf index ddcc0ceec..77d315a96 100644 --- a/SQF/dayz_code/system/REsec.sqf +++ b/SQF/dayz_code/system/REsec.sqf @@ -1,6 +1,6 @@ /* Created exclusively for ArmA2:OA - DayZMod. - Please request permission to use/alter/distribute from project leader (R4Z0R49) AND the author (facoptere@gmail.com) + Please request permission to use/alter/distribute from project leader (R4Z0R49) && the author (facoptere@gmail.com) */ _REMOVED_LIB = ["addAction", "addEventhandler", "addMagazine", "addMagazineCargo", "addWeapon","addWeaponCargo", "addWPCur", "animate", "callVar", "clearMagazineCargo", "clearWeaponCargo", "createDiaryRecord","createMarkerLocal", "createSimpleTask", "createTaskSet", "debugLog", "deleteWP", "enablesimulation", "endMission","execfsm", "fadeMusic", "fadeSound", "failMission", "globalChat", "globalRadio", "groupChat", "groupRadio","hideObject", "hint", "hintC", "kbAddTopic", "kbreact", "kbRemoveTopic", "kbtell", "land", "move", "moveIn","playAction", "playActionnow", "playmovenow", "playMusic", "playsound", "removeAction","removeAllWeapons", "setCaptive", "setCurrentTask", "setCurrentTaskArrays", "setDate", "setDir", "setGroupID","setMarkerPosLocal", "setObjectTexture", "setSimpleTaskDescription", "setTaskState", "setWPdesc", "setWPtype","showCommandingMenu", "sideChat", "sideRadio", "skiptime", "spawn", "switchAction", "switchCamera", "taskHint","titleCut", "Hangender"]; @@ -13,17 +13,17 @@ private["_ofn","_nfn","_REMOVED_LIB","_TRACED_LIB"]; _ofn=format["r%1code",_x]; _nfn=format["r%1code%2",_x,round(random(100000))]; if(_x=="execVM")then{ - call compile format["%1=%2;%2={if((count _this>=3)AND{(!((_this select 2)IN%3))})then{diag_log(""WARNING RE %2 with illegal args:""+str(_this));}else{_this call %1}};",_nfn,_ofn,["ca\Modules\Functions\init.sqf"]]; + call compile format["%1=%2;%2={if((count _this>=3)&&{(!((_this select 2)IN%3))})then{diag_log(""WARNING RE %2 with illegal args:""+str(_this));}else{_this call %1}};",_nfn,_ofn,["ca\Modules\Functions\init.sqf"]]; }else{ #ifdef RESEC_VERBOSE call compile format ["%1=%2;%2={diag_log(""RE %2 args:""+str(_this));_this call %1};",_nfn,_ofn]; #endif }; -}foreach _TRACED_LIB; +}count _TRACED_LIB; { _ofn=format["r%1code",_x]; call compile format["%1={diag_log(""WARNING illegal RE %1 with args:""+str(_this));};",_ofn]; -}foreach _REMOVED_LIB; +}count _REMOVED_LIB; #ifndef SKIP_REMOTEEXECUTIONSERVER []spawn{ @@ -45,8 +45,8 @@ private["_ofn","_nfn","_REMOVED_LIB","_TRACED_LIB"]; }; if(typeName _co==""STRING"")then{ { - if(!((_x>=65&&_x<=90)OR(_x>=97&&_x<=122))) exitWith {diag_log(""WARNING possible code injection args:""+str(_this)); _this=[];}; - }forEach (toArray _co); + if(!((_x>=65&&_x<=90)||(_x>=97&&_x<=122))) exitWith {diag_log(""WARNING possible code injection args:""+str(_this)); _this=[];}; + }count (toArray _co); }; }; _this call "+_nfn+"};" diff --git a/SQF/dayz_code/system/animal_agent.fsm b/SQF/dayz_code/system/animal_agent.fsm index 6d67540fb..8165a5b48 100644 --- a/SQF/dayz_code/system/animal_agent.fsm +++ b/SQF/dayz_code/system/animal_agent.fsm @@ -92,7 +92,7 @@ class FSM priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeA) > 120 and !_isSomeone"/*%FSM*/; + condition=/*%FSM*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -181,7 +181,7 @@ class FSM priority = 0.000000; to="End"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(time - _timeA) > 120 and !_isSomeone"/*%FSM*/; + condition=/*%FSM*/"(time - _timeA) > 120 && !_isSomeone"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ diff --git a/SQF/dayz_code/system/antihack.sqf b/SQF/dayz_code/system/antihack.sqf index 7552d3b40..3bba37335 100644 --- a/SQF/dayz_code/system/antihack.sqf +++ b/SQF/dayz_code/system/antihack.sqf @@ -28,7 +28,7 @@ waitUntil {vehicle player == player}; while {true} do { sleep 5; }; - PVDZE_atp = format["WARNING PLAYER WITH NAME (%1) and UID# (%2) HAS CHANGED THE TRUE VALUE TO FALSE", _playerName, _playerUID]; + PVDZE_atp = format["WARNING PLAYER WITH NAME (%1) && UID# (%2) HAS CHANGED THE TRUE VALUE TO FALSE", _playerName, _playerUID]; publicVariableServer "PVDZE_atp"; endMission "LOSER"; sleep 10; @@ -48,13 +48,13 @@ while {1 == 1} do { _topv = 0; _toph = 0; - while {((typeName player == "OBJECT") AND {((player in playableUnits) OR {(alive player)})})} do { + while {((typeName player == "OBJECT") && {((player in playableUnits) || {(alive player)})})} do { _curpos = getPosATL (vehicle player); _distance = _lastpos distance _curpos; _curtime = diag_ticktime; _difftime = _curtime - _lasttime; - if ((_distance > 10) OR {(_difftime > 1)}) then { + if ((_distance > 10) || {(_difftime > 1)}) then { if (!_al1veOnce) then { private [ "_loc", "_plant"]; // check that plants libs are properly loaded @@ -69,7 +69,7 @@ while {1 == 1} do { endMission "LOSER"; }; deleteVehicle _plant; - } forEach ["grass", "prunus", "picea", "fallentree", "phragmites", "acer", "amygdalusn", "Brush", "fiberplant", "amygdalusc", "boulder"]; + } count ["grass", "prunus", "picea", "fallentree", "phragmites", "acer", "amygdalusn", "Brush", "fiberplant", "amygdalusc", "boulder"]; diag_log format [ "%1: Plants libs tests done!", __FILE__]; }; _al1veOnce = true; @@ -86,7 +86,7 @@ while {1 == 1} do { _safetyVehicle = vehicle player; if (_lastVehicle == vehicle player) then { - if ((_speed > _topSpeed) && (alive player) && ((driver (vehicle player) == player) or (isNull (driver (vehicle player)))) && (_debug distance _lastpos > 3000) && !((vehicle player == player) && (_curheight < _lastheight) && ((_curheight - _terrainHeight) > 1))) then { + if ((_speed > _topSpeed) && (alive player) && ((driver (vehicle player) == player) || (isNull (driver (vehicle player)))) && (_debug distance _lastpos > 3000) && !((vehicle player == player) && (_curheight < _lastheight) && ((_curheight - _terrainHeight) > 1))) then { (vehicle player) setposATL _lastpos; //PVDZE_atp = [name player, dayz_characterID, _lastpos, _curPos, getPosATL player]; PVDZE_atp = format["TELEPORT REVERT for player UID#%1 from %2 to %3, %4 meters, now at %5", getPlayerUID player, _lastpos, _curPos, round(_lastpos distance _curpos), getPosATL player]; @@ -108,7 +108,7 @@ while {1 == 1} do { // freefall detection: _v = -((velocity player) select 2); _h = (getPosATL player) select 2; - if (_v > 4 AND _h > 3) then { + if (_v > 4 && _h > 3) then { _topv = _topv max _v; _toph = _toph max _h; Dayz_freefall = [ time, _toph, _topv ]; diff --git a/SQF/dayz_code/system/building_monitor.sqf b/SQF/dayz_code/system/building_monitor.sqf index 64da41701..795dea4c5 100644 --- a/SQF/dayz_code/system/building_monitor.sqf +++ b/SQF/dayz_code/system/building_monitor.sqf @@ -9,10 +9,10 @@ while {_run} do { _nearby = false; { if (_x distance _building < 500) then {_nearby = true}; - } forEach (call BIS_fnc_listPlayers); + } count (call BIS_fnc_listPlayers); if (!_nearby) then {_run = false}; sleep 5; }; -{deleteVehicle _x;} forEach _items; +{deleteVehicle _x;} count _items; _building setVariable ["looted",(DateToNumber date),true]; \ No newline at end of file diff --git a/SQF/dayz_code/system/ca/functions/init.sqf b/SQF/dayz_code/system/ca/functions/init.sqf index 964e5d2d0..4b434fd5d 100644 --- a/SQF/dayz_code/system/ca/functions/init.sqf +++ b/SQF/dayz_code/system/ca/functions/init.sqf @@ -6,11 +6,11 @@ textLogFormat ["PRELOAD_ Functions\init.sqf %1", _this]; Description: Function library initialization. - All files have to start with 'fn_' prefix and they name have to be same as name of function. + All files have to start with 'fn_' prefix && they name have to be same as name of function. Don't forget to exclude comma after last item in array! Caution: - Do not execute this init directly - there is dependency with MPF and need to run on all machines. + Do not execute this init directly - there is dependency with MPF && need to run on all machines. Parameter(s): _this select 0: 'Function manager' logic @@ -33,7 +33,7 @@ textLogFormat ["Log: [Functions] Init script executed at %1",time]; //--- PREPROCESS ----------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------- -//--- Create variables for all functions (and preprocess them after first call) +//--- Create variables for all functions (&& preprocess them after first call) for "_t" from 0 to 2 do { _pathConfig = [configfile,campaignconfigfile,missionconfigfile] select _t; _pathFile = ["ca\modules\functions","functions","functions"] select _t; diff --git a/SQF/dayz_code/system/dog_agent.fsm b/SQF/dayz_code/system/dog_agent.fsm index b7f4f3788..b4de1f47e 100644 --- a/SQF/dayz_code/system/dog_agent.fsm +++ b/SQF/dayz_code/system/dog_agent.fsm @@ -107,7 +107,7 @@ item102[] = {"target_lost",4,218,525.000000,-475.000000,625.000000,-425.000000,0 item103[] = {"target_dead",4,218,525.000000,-525.000000,625.000000,-475.000000,0.000000,"target dead"}; item104[] = {"",7,210,696.000000,-154.000000,704.000000,-146.000000,0.000000,""}; item105[] = {"find_target",4,218,350.000000,-275.000000,450.000000,-225.000000,1.000000,"find target"}; -item106[] = {"DayZ_Dog_Agent_FSM",-1,250,-475.000000,-625.000000,-75.000000,-425.000000,0.000000,"DayZ Dog Agent FSM" \n "Created by Rocket and Alby"}; +item106[] = {"DayZ_Dog_Agent_FSM",-1,250,-475.000000,-625.000000,-75.000000,-425.000000,0.000000,"DayZ Dog Agent FSM" \n "Created by Rocket && Alby"}; item107[] = {"____FAKE____",9,4280,0.000000,0.000000,0.000000,0.000000,0.000000,"____FAKE____"}; version=1; class LayoutItems @@ -314,7 +314,7 @@ class FSM priority = 0.000000; to="action_init"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"dayz_clientPreload and (!isNil ""_handle"")"/*%FSM*/; + condition=/*%FSM*/"dayz_clientPreload && (!isNil ""_handle"")"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ @@ -435,7 +435,7 @@ class FSM priority = 0.000000; to="Sitting"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"((time - _waitTime) > _idleTime) and _standing"/*%FSM*/; + condition=/*%FSM*/"((time - _waitTime) > _idleTime) && _standing"/*%FSM*/; action=/*%FSM*/"_standing = false;" \n "if (!_watchDog) then {" \n " _move = ""Dog_LieDown"";" \n @@ -605,7 +605,7 @@ class FSM precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_command != ""stay"""/*%FSM*/; action=/*%FSM*/"if (_command == ""return"") then {" \n - " if ((player distance _dog > 5) and (_watchDog)) then {" \n + " if ((player distance _dog > 5) && (_watchDog)) then {" \n " _dog playActionNow ""GestureBark"";" \n " [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n " };" \n @@ -655,7 +655,7 @@ class FSM priority = 4.000000; to="Waiting"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"isNull _target and ((time - _waitTime) > 2)"/*%FSM*/; + condition=/*%FSM*/"isNull _target && ((time - _waitTime) > 2)"/*%FSM*/; action=/*%FSM*/"_command = ""none"";"/*%FSM*/; }; /*%FSM*/ @@ -680,7 +680,7 @@ class FSM precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_command != ""track"""/*%FSM*/; action=/*%FSM*/"if (_command == ""return"") then {" \n - " if ((player distance _dog > 5) and (_watchDog)) then {" \n + " if ((player distance _dog > 5) && (_watchDog)) then {" \n " _dog playActionNow ""GestureBark"";" \n " [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n " };" \n @@ -694,7 +694,7 @@ class FSM to="Tracking"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"((time - _waitTime) > 0.5)"/*%FSM*/; - action=/*%FSM*/"if ((random 1) < 0.3 and (time - _coolDown > 4) and _dog distance _target > 10 ) then {" \n + action=/*%FSM*/"if ((random 1) < 0.3 && (time - _coolDown > 4) && _dog distance _target > 10 ) then {" \n " _dog playActionNow ""GestureSniff"";" \n " _coolDown = time;" \n "};"/*%FSM*/; @@ -739,7 +739,7 @@ class FSM priority = 4.000000; to="Waiting"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"isNull _target and ((time - _waitTime) > 2)"/*%FSM*/; + condition=/*%FSM*/"isNull _target && ((time - _waitTime) > 2)"/*%FSM*/; action=/*%FSM*/"_command = ""none"";"/*%FSM*/; }; /*%FSM*/ @@ -749,7 +749,7 @@ class FSM priority = 1.000000; to="Tracking"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNull _target and ((time - _waitTime) > 2)"/*%FSM*/; + condition=/*%FSM*/"!isNull _target && ((time - _waitTime) > 2)"/*%FSM*/; action=/*%FSM*/"_lastPos = [_dog] call FNC_GetPos;"/*%FSM*/; }; /*%FSM*/ @@ -932,7 +932,7 @@ class FSM precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_command != ""none"""/*%FSM*/; action=/*%FSM*/"if (_command == ""return"") then {" \n - " if ((player distance _dog > 5) and (_watchDog)) then {" \n + " if ((player distance _dog > 5) && (_watchDog)) then {" \n " _dog playActionNow ""GestureBark"";" \n " [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n " };" \n @@ -1044,7 +1044,7 @@ class FSM to="Waiting"; precondition = /*%FSM*/""/*%FSM*/; condition=/*%FSM*/"_command == ""return"""/*%FSM*/; - action=/*%FSM*/"if ((player distance _dog > 5) and (_watchDog)) then {" \n + action=/*%FSM*/"if ((player distance _dog > 5) && (_watchDog)) then {" \n " _dog playActionNow ""GestureBark"";" \n " [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n "};"/*%FSM*/; @@ -1115,7 +1115,7 @@ class FSM "_dog setVariable [""state"", ""passive"", true];" \n "" \n "if (_command == ""return"") then {" \n - " if ((player distance _dog > 5) and (_watchDog)) then {" \n + " if ((player distance _dog > 5) && (_watchDog)) then {" \n " _dog playActionNow ""GestureBark"";" \n " [_dog,""dog_bark"",0,false] call dayz_zombieSpeak;" \n " };" \n diff --git a/SQF/dayz_code/system/fire_monitor.sqf b/SQF/dayz_code/system/fire_monitor.sqf index df641c40c..42539d600 100644 --- a/SQF/dayz_code/system/fire_monitor.sqf +++ b/SQF/dayz_code/system/fire_monitor.sqf @@ -1,7 +1,7 @@ private["_firePlace","_ok","_mags","_serial","_qty","_countr"]; _firePlace = _this; while {alive _firePlace} do { - while {inflamed _firePlace and alive _fireplace} do { + while {inflamed _firePlace && alive _fireplace} do { //Use Wood _ok = false; _mags = getMagazineCargo _firePlace; @@ -33,7 +33,7 @@ while {alive _firePlace} do { _firePlace inflame false; }; }; - while {!inflamed _firePlace and alive _fireplace} do { + while {!inflamed _firePlace && alive _fireplace} do { //Wait sleep 1; }; diff --git a/SQF/dayz_code/system/handleGear.sqf b/SQF/dayz_code/system/handleGear.sqf index 36fe2d9c3..c0d20c94c 100644 --- a/SQF/dayz_code/system/handleGear.sqf +++ b/SQF/dayz_code/system/handleGear.sqf @@ -369,7 +369,7 @@ _filterItems = { LB_CTRL = _lbcontrol; { _lbcontrol lnbDeleteRow _x; - } forEach _deleteIndexes; + } count _deleteIndexes; }; _itemPicture = { diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm index 5ead38662..dd04ffbf8 100644 --- a/SQF/dayz_code/system/player_monitor.fsm +++ b/SQF/dayz_code/system/player_monitor.fsm @@ -60,7 +60,7 @@ item55[] = {"get_ready_to_clo",2,250,400.000000,400.000000,500.000000,450.000000 item56[] = {"sleep_",4,218,550.000000,400.000000,650.000000,450.000000,0.000000,"sleep" \n ""}; item57[] = {"Disconnect",2,250,825.000000,400.000000,925.000000,450.000000,0.000000,"Disconnect"}; item58[] = {"No_time_date",4,218,25.000000,1150.000000,125.000000,1200.000000,0.000000,"No time/date"}; -item59[] = {"ERROR__No_Date_or",2,250,175.000000,1150.000000,275.000000,1200.000000,0.000000,"ERROR:" \n "No Date or Time"}; +item59[] = {"ERROR__No_Date_or",2,250,175.000000,1150.000000,275.000000,1200.000000,0.000000,"ERROR:" \n "No Date || Time"}; item60[] = {"Too_Long",4,218,300.000000,1150.000000,400.000000,1200.000000,0.000000,"Too" \n "Long"}; item61[] = {"get_ready_to_clo_1",2,250,450.000000,800.000000,550.000000,850.000000,0.000000,"get ready to close"}; item62[] = {"sleep_",4,218,600.000000,800.000000,700.000000,850.000000,0.000000,"sleep" \n ""}; @@ -334,10 +334,10 @@ class FSM " _charPos = getPosATL player;" \n " _playerPos = [round(direction player),_charPos];" \n " " \n - " if (_onLadder or _isInVehicle or _isTerminal) then {" \n + " if (_onLadder || _isInVehicle || _isTerminal) then {" \n " _currentAnim = """";" \n " //If position to be updated, make sure it is at ground level!" \n - " if ((count _playerPos > 0) and !_isTerminal) then {" \n + " if ((count _playerPos > 0) && !_isTerminal) then {" \n " _charPos set [2,0];" \n " _playerPos set[1,_charPos];" \n " };" \n @@ -698,7 +698,7 @@ class FSM " };" \n " dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];" \n " _countr = _countr + 1;" \n - " } forEach _backpackWpnTypes;" \n + " } count _backpackWpnTypes;" \n " " \n " //Magazines" \n " _countr = 0;" \n @@ -707,7 +707,7 @@ class FSM " if (_x == ""ItemTent"") then { _x = ""ItemTentOld"" };" \n " dayz_myBackpack addMagazineCargoGlobal [_x,(_backpackMagQty select _countr)];" \n " _countr = _countr + 1;" \n - " } forEach _backpackMagTypes;" \n + " } count _backpackMagTypes;" \n " " \n " dayz_myBackpackMags = getMagazineCargo dayz_myBackpack;" \n " dayz_myBackpackWpns = getWeaponCargo dayz_myBackpack;" \n @@ -772,7 +772,7 @@ class FSM " freshSpawn = 0;" \n "};" \n "" \n - "if(dayz_paraSpawn and (freshSpawn == 2)) then {" \n + "if(dayz_paraSpawn && (freshSpawn == 2)) then {" \n " player setDir _setDir;" \n " player setPosATL [(_setPos select 0),(_setPos select 1),2000];" \n " [player,2000] spawn BIS_fnc_halo;" \n @@ -793,8 +793,8 @@ class FSM " usecBleed = [player,_x,_x];" \n " publicVariable ""usecBleed""; // draw blood stream on character, on all gameclients" \n " };" \n - "} forEach USEC_typeOfWounds;" \n - "//Legs and Arm fractures" \n + "} count USEC_typeOfWounds;" \n + "//Legs && Arm fractures" \n "_legs = player getVariable [""hit_legs"",0];" \n "_arms = player getVariable [""hit_hands"",0];" \n "" \n @@ -814,7 +814,7 @@ class FSM "" \n "dayz_playerUID = _playerUID;" \n "" \n - "if ((_isNew) OR (count _inventory == 0)) then {" \n + "if ((_isNew) || (count _inventory == 0)) then {" \n " //player is new, add initial loadout only if player is not pzombie" \n " if(!(player isKindOf ""PZombie_VB"")) then {" \n " _config = (configFile >> ""CfgSurvival"" >> ""Inventory"" >> ""Default"");" \n @@ -840,13 +840,13 @@ class FSM " if (_isOK) then {" \n " player addMagazine _x;" \n " };" \n - " } forEach _mags;" \n + " } count _mags;" \n " {" \n " _isOK = isClass(configFile >> ""CfgWeapons"" >> _x);" \n " if (_isOK) then {" \n " player addWeapon _x;" \n " };" \n - " } forEach _wpns;" \n + " } count _wpns;" \n " " \n " if (_bcpk != """") then {" \n " player addBackpack _bcpk; " \n @@ -859,7 +859,7 @@ class FSM " } else {" \n " dayz_myBackpack addMagazineCargoGlobal [_x, 1];" \n " };" \n - " } forEach _bcpkItems;" \n + " } count _bcpkItems;" \n " } else {" \n " if (_bcpkItems != """") then {" \n " dayz_myBackpack addMagazineCargoGlobal [_bcpkItems, 1];" \n @@ -975,7 +975,7 @@ class FSM " _ctrlBleed = _display displayCtrl 1303;" \n " _ctrlBleed ctrlShow false;" \n " };" \n - " if (!r_fracture_legs and !r_fracture_arms) then {" \n + " if (!r_fracture_legs && !r_fracture_arms) then {" \n " _ctrlFracture = _display displayCtrl 1203;" \n " _ctrlFracture ctrlShow false;" \n " };" \n @@ -1014,7 +1014,7 @@ class FSM name = "Load_In"; init = /*%FSM*/"//Reveal action types" \n "" \n - "{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n + "{player reveal _x} count (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n "" \n "dayz_clientPreload = true;" \n "3 fadeSound 1;" \n @@ -1028,7 +1028,7 @@ class FSM " } else {" \n " _id = [_x,1] spawn object_roadFlare " \n " };" \n - " } forEach (allMissionObjects ""LitObject"");"/*%FSM*/; + " } count (allMissionObjects ""LitObject"");"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { @@ -1104,7 +1104,7 @@ class FSM " if (count _state > 2) then {" \n " dayz_temperatur = _state select 2;" \n " }; " \n - " if ((count _state > 3) and DZE_FriendlySaving) then {" \n + " if ((count _state > 3) && DZE_FriendlySaving) then {" \n " DZE_Friends = _state select 3;" \n " }; " \n "} else {" \n @@ -1135,7 +1135,7 @@ class FSM "" \n "reload player;" \n "" \n - "if (_currentAnim != """" and !dayz_paraSpawn) then {" \n + "if (_currentAnim != """" && !dayz_paraSpawn) then {" \n " [objNull, player, rSwitchMove,_currentAnim] call RE;" \n "};" \n "" \n @@ -1283,7 +1283,7 @@ class FSM "};" \n "" \n "// TODO: questionably" \n - "{ _x call fnc_veh_ResetEH; } forEach vehicles;" \n + "{ _x call fnc_veh_ResetEH; } count vehicles;" \n "" \n "private[""_fadeFire""];" \n "{" \n @@ -1291,14 +1291,14 @@ class FSM " if (!_fadeFire) then {" \n " _nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n " };" \n - "} forEach entities ""SpawnableWreck"";" \n + "} count entities ""SpawnableWreck"";" \n "" \n "// remove box " \n "[] spawn {" \n " private [""_counter""];" \n " _counter = 0;" \n " while {true} do {" \n - " if ((player getVariable[""combattimeout"", 0] >= time) or (_counter >= 60) or (player distance DZE_PROTOBOX > 2)) exitWith {" \n + " if ((player getVariable[""combattimeout"", 0] >= time) || (_counter >= 60) || (player distance DZE_PROTOBOX > 2)) exitWith {" \n " deleteVehicle DZE_PROTOBOX;" \n " };" \n " sleep 1;" \n @@ -1472,7 +1472,7 @@ class FSM "//[false] call stream_locationCheck;" \n "" \n "_zombies = (getPosATL player) nearEntities [""zZombie_Base"",25];" \n - "{deleteVehicle _x} forEach _zombies;" \n + "{deleteVehicle _x} count _zombies;" \n "" \n "endLoadingScreen;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; @@ -1559,7 +1559,7 @@ class FSM name = "Disconnect"; init = /*%FSM*/"endLoadingScreen;" \n "" \n - "// disable player interaction and move him off site" \n + "// disable player interaction && move him off site" \n "// player setPos [10,10,100000];" \n " player enableSimulation false;" \n "" \n diff --git a/SQF/dayz_code/system/player_spawn_1.sqf b/SQF/dayz_code/system/player_spawn_1.sqf index 71bdfe4d9..0501c40ee 100644 --- a/SQF/dayz_code/system/player_spawn_1.sqf +++ b/SQF/dayz_code/system/player_spawn_1.sqf @@ -16,7 +16,7 @@ while {true} do { _delMe = true; }; _cursor = _cursor + 1; - } forEach dayz_buildingMonitor; + } count dayz_buildingMonitor; if (_delMe) then { dayz_buildingMonitor = dayz_buildingMonitor - ["DEL"]; }; diff --git a/SQF/dayz_code/system/player_spawn_2.sqf b/SQF/dayz_code/system/player_spawn_2.sqf index 5835a9204..6f38f5b1a 100644 --- a/SQF/dayz_code/system/player_spawn_2.sqf +++ b/SQF/dayz_code/system/player_spawn_2.sqf @@ -36,7 +36,7 @@ while {true} do { // Check for radiation DZE_InRadiationZone = false; - _outsideMap = ((dayz_myPosition select 0) < dayz_minpos OR (dayz_myPosition select 1) < dayz_minpos OR (dayz_myPosition select 0) > dayz_maxpos OR (dayz_myPosition select 1) > dayz_maxpos); + _outsideMap = ((dayz_myPosition select 0) < dayz_minpos || (dayz_myPosition select 1) < dayz_minpos || (dayz_myPosition select 0) > dayz_maxpos || (dayz_myPosition select 1) > dayz_maxpos); if((_outsideMap || DZE_Quarantine) && !r_player_dead && !isNull (findDisplay 46)) then { DZE_InRadiationZone = true; @@ -60,17 +60,17 @@ while {true} do { if (!_inVehicle) then { _thirst = (_speed + 4) * 3; }; - dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss + dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% && + 16.6% waterloss //Temperatur 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange - if ((_lastTemp - dayz_temperatur) > 0.75 or (_lastTemp - dayz_temperatur) < -0.75 ) then { + if ((_lastTemp - dayz_temperatur) > 0.75 || (_lastTemp - dayz_temperatur) < -0.75 ) then { player setVariable ["temperature",dayz_temperatur,true]; _lastTemp = dayz_temperatur; }; //can get nearby infection - if (!r_player_infected and !_isPZombie) then { + if (!r_player_infected && !_isPZombie) then { //Infectionriskstart if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange _listTalk = (getPosATL _refObj) nearEntities ["CAManBase",8]; @@ -85,7 +85,7 @@ while {true} do { }; }; }; - } forEach _listTalk; + } count _listTalk; if (dayz_temperatur < ((50 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 25); //TeeChange if (_rnd < 0.05) then { @@ -99,7 +99,7 @@ while {true} do { }; }; - //If has infection reduce blood cough and add shake + //If has infection reduce blood cough && add shake if (r_player_infected) then { if !(player getVariable["USEC_infected",false]) then { player setVariable["USEC_infected",true,true]; @@ -117,7 +117,7 @@ while {true} do { }; //Pain Shake Effects - if (r_player_inpain and !r_player_unconscious) then { + if (r_player_inpain && !r_player_unconscious) then { playSound "breath_1"; addCamShake [2, 1, 25]; }; @@ -147,7 +147,7 @@ while {true} do { _radsound = "radzone1"; _bloodloss = 10; - if(_radTimer > 5 AND _radTimer < 10) then { + if(_radTimer > 5 && _radTimer < 10) then { _radsound = "radzone2"; _bloodloss = 20; }; @@ -172,9 +172,9 @@ while {true} do { _radTimer = 0; }; - // Health uptick when healty not thirsty or hungry - if (_foodVal >= 0.9 and _thirstVal >= 0.9) then { - if (!r_player_infected and !r_player_inpain and !r_player_injured and !DZE_InRadiationZone) then { + // Health uptick when healty not thirsty || hungry + if (_foodVal >= 0.9 && _thirstVal >= 0.9) then { + if (!r_player_infected && !r_player_inpain && !r_player_injured && !DZE_InRadiationZone) then { _result = r_player_blood + 10; if (_result >= r_player_bloodTotal) then { r_player_blood = r_player_bloodTotal; @@ -186,7 +186,7 @@ while {true} do { //Record low blood _lowBlood = player getVariable ["USEC_lowBlood", false]; - if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then { + if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then { player setVariable["USEC_lowBlood",true,true]; }; @@ -214,7 +214,7 @@ while {true} do { }; }; - // If in combat, display counter and restrict logout + // If in combat, display counter && restrict logout _startcombattimer = player getVariable["startcombattimer",0]; if (_startcombattimer == 1) then { player setVariable["combattimeout", time + 30, true]; diff --git a/SQF/dayz_code/system/zombie_agent.fsm b/SQF/dayz_code/system/zombie_agent.fsm index 00b5cba2f..1024fdc36 100644 --- a/SQF/dayz_code/system/zombie_agent.fsm +++ b/SQF/dayz_code/system/zombie_agent.fsm @@ -173,7 +173,7 @@ class FSM priority = 0.000000; to="Begin"; precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"dayz_clientPreload and !(isNull _agent)"/*%FSM*/; + condition=/*%FSM*/"dayz_clientPreload && !(isNull _agent)"/*%FSM*/; action=/*%FSM*/""/*%FSM*/; }; /*%FSM*/ diff --git a/SQF/dayz_server/compile/server_maintainArea.sqf b/SQF/dayz_server/compile/server_maintainArea.sqf index b7bcd6360..6034f3ebd 100644 --- a/SQF/dayz_server/compile/server_maintainArea.sqf +++ b/SQF/dayz_server/compile/server_maintainArea.sqf @@ -17,7 +17,7 @@ if (_option == 1) then { _objectUID = _x getVariable ["ObjectUID","0"]; if (_objectUID != "0") then { _x setDamage 0; - _key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0" + _key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" && ID is "0" _data = "HiveExt" callExtension _key; }; } else { @@ -26,7 +26,7 @@ if (_option == 1) then { _data = "HiveExt" callExtension _key; }; }; - } forEach _objects; + } count _objects; _name = if (alive _player) then { name _player; } else { "Dead Player"; }; diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", _name, count _objects, (getPosATL _player)]; }; @@ -37,7 +37,7 @@ if (_option == 2) then { _objectUID = _targetObj getVariable ["ObjectUID","0"]; if (_objectUID != "0") then { _targetObj setDamage 0; - _key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" and ID is "0" + _key = format["CHILD:397:%1:", _objectUID]; // use UID if not "0" && ID is "0" _data = "HiveExt" callExtension _key; }; } else { diff --git a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf index 58ff73d16..b4b73f064 100644 --- a/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf +++ b/SQF/dayz_server/compile/server_onPlayerDisconnect.sqf @@ -5,7 +5,7 @@ _playerObj = nil; _playerPos = []; { if ((getPlayerUID _x) == _playerUID) exitWith {_playerObj = _x;}; -} forEach playableUnits; +} count playableUnits; if (isNil "_playerObj") then { diag_log format["nil player object attempting PV, :%1", _this]; @@ -53,7 +53,7 @@ if (!isNull _playerObj) then { if (alive _playerObj) then { - _isplayernearby = (DZE_BackpackGuard and !_invehicle and ({(isPlayer _x) and (alive _x)} count (_playerPos nearEntities ["AllVehicles", 5]) > 1)); + _isplayernearby = (DZE_BackpackGuard && !_invehicle && ({(isPlayer _x) && (alive _x)} count (_playerPos nearEntities ["AllVehicles", 5]) > 1)); // prevent saving more than 20 magazine items _magazines = [(magazines _playerObj),20] call array_reduceSize; @@ -66,6 +66,6 @@ if (!isNull _playerObj) then { //Update Vehicle { [_x,"gear"] call server_updateObject; - } foreach (nearestObjects [_playerPos, dayz_updateObjects, 10]); + } count (nearestObjects [_playerPos, dayz_updateObjects, 10]); }; }; diff --git a/SQF/dayz_server/compile/server_playerDied.sqf b/SQF/dayz_server/compile/server_playerDied.sqf index 7bca73837..1ca812c00 100644 --- a/SQF/dayz_server/compile/server_playerDied.sqf +++ b/SQF/dayz_server/compile/server_playerDied.sqf @@ -13,8 +13,8 @@ _newObject setVariable ["bodyName", _victimName, true]; _killer = _victim getVariable["AttackedBy", "nil"]; _killerName = _victim getVariable["AttackedByName", "nil"]; -// when a zombie kills a player _killer, _killerName and _weapon will be "nil" -// we can use this to determine a zombie kill and send a customized message for that. right now no killmsg means it was a zombie. +// when a zombie kills a player _killer, _killerName && _weapon will be "nil" +// we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie. if (_killerName != "nil") then { _weapon = _victim getVariable["AttackedByWeapon", "nil"]; diff --git a/SQF/dayz_server/compile/server_playerLogin.sqf b/SQF/dayz_server/compile/server_playerLogin.sqf index 730fd4e1d..a68bef20c 100644 --- a/SQF/dayz_server/compile/server_playerLogin.sqf +++ b/SQF/dayz_server/compile/server_playerLogin.sqf @@ -31,7 +31,7 @@ if (_playerID == "") then { _playerID = getPlayerUID _playerObj; }; -if ((_playerID == "") or (isNil "_playerID")) exitWith { +if ((_playerID == "") || (isNil "_playerID")) exitWith { #ifdef DZE_SERVER_DEBUG diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID"); #endif @@ -54,7 +54,7 @@ while {_doLoop < 5} do { _doLoop = _doLoop + 1; }; -if (isNull _playerObj or !isPlayer _playerObj) exitWith { +if (isNull _playerObj || !isPlayer _playerObj) exitWith { #ifdef DZE_SERVER_DEBUG diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj)); #endif diff --git a/SQF/dayz_server/compile/server_playerSetup.sqf b/SQF/dayz_server/compile/server_playerSetup.sqf index 8d6542e4a..f00e12037 100644 --- a/SQF/dayz_server/compile/server_playerSetup.sqf +++ b/SQF/dayz_server/compile/server_playerSetup.sqf @@ -47,7 +47,7 @@ while {_doLoop < 5} do { _doLoop = _doLoop + 1; }; -if (isNull _playerObj or !isPlayer _playerObj) exitWith { +if (isNull _playerObj || !isPlayer _playerObj) exitWith { diag_log ("SETUP RESULT: Exiting, player object null: " + str(_playerObj)); }; @@ -112,7 +112,7 @@ if (count _medical > 0) then { //["usecBleed",[_playerObj,_x,_hit]] call broadcastRpcCallAll; usecBleed = [_playerObj,_x,_hit]; publicVariable "usecBleed"; - } forEach (_medical select 8); + } count (_medical select 8); //Add fractures _fractures = (_medical select 9); @@ -194,12 +194,12 @@ if (_randomSpot) then { _mkr = ""; while {_findSpot} do { _counter = 0; - while {_counter < 20 and _findSpot} do { + while {_counter < 20 && _findSpot} do { // switched to floor _mkr = "spawn" + str(floor(random _spawnMC)); _position = ([(getMarkerPos _mkr),0,spawnArea,10,0,2000,spawnShoremode] call BIS_fnc_findSafePos); _isNear = count (_position nearEntities ["Man",100]) == 0; - _isZero = ((_position select 0) == 0) and ((_position select 1) == 0); + _isZero = ((_position select 0) == 0) && ((_position select 1) == 0); //Island Check //TeeChange _pos = _position; _isIsland = false; //Can be set to true during the Check @@ -210,11 +210,11 @@ if (_randomSpot) then { }; }; - if ((_isNear and !_isZero) || _isIsland) then {_findSpot = false}; + if ((_isNear && !_isZero) || _isIsland) then {_findSpot = false}; _counter = _counter + 1; }; }; - _isZero = ((_position select 0) == 0) and ((_position select 1) == 0); + _isZero = ((_position select 0) == 0) && ((_position select 1) == 0); _position = [_position select 0,_position select 1,0]; if (!_isZero) then { //_playerObj setPosATL _position; diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf index 46956240b..f8592d02a 100644 --- a/SQF/dayz_server/compile/server_playerSync.sqf +++ b/SQF/dayz_server/compile/server_playerSync.sqf @@ -59,15 +59,15 @@ if (_characterID != "0") then { //diag_log ("Found Character..."); //Check if update is requested - if (_isNewPos or _force) then { + if (_isNewPos || _force) then { //diag_log ("position..." + str(_isNewPos) + " / " + str(_force)); sleep 0.05; - if (((_charPos select 0) == 0) and ((_charPos select 1) == 0)) then { + if (((_charPos select 0) == 0) && ((_charPos select 1) == 0)) then { //Zero Position } else { //diag_log ("getting position..."); sleep 0.05; _playerPos = [round(direction _character),_charPos]; _lastPos = _character getVariable["lastPos",_charPos]; - if (count _lastPos > 2 and count _charPos > 2) then { + if (count _lastPos > 2 && count _charPos > 2) then { if (!_isInVehicle) then { _distanceFoot = round(_charPos distance _lastPos); }; @@ -80,7 +80,7 @@ if (_characterID != "0") then { }; _character setVariable ["posForceUpdate",false,true]; }; - if (_isNewGear or _forceGear) then { + if (_isNewGear || _forceGear) then { //diag_log ("gear..."); sleep 0.05; _playerGear = [weapons _character,_magazines]; //diag_log ("playerGear: " +str(_playerGear)); @@ -92,7 +92,7 @@ if (_characterID != "0") then { _playerBackp = [typeOf _backpack,getWeaponCargo _backpack,getMagazineCargo _backpack]; }; }; - if (_isNewMed or _force) then { + if (_isNewMed || _force) then { //diag_log ("medical..."); sleep 0.05; if (!(_character getVariable["USEC_isDead",false])) then { //diag_log ("medical check..."); sleep 0.05; @@ -143,10 +143,10 @@ if (_characterID != "0") then { _character setVariable ["model_CHK",typeOf _character]; }; - if (_onLadder or _isInVehicle or _isTerminal) then { + if (_onLadder || _isInVehicle || _isTerminal) then { _currentAnim = ""; //If position to be updated, make sure it is at ground level! - if ((count _playerPos > 0) and !_isTerminal) then { + if ((count _playerPos > 0) && !_isTerminal) then { _charPos set [2,0]; _playerPos set[1,_charPos]; }; @@ -167,7 +167,7 @@ if (_characterID != "0") then { _temp = round(_character getVariable ["temperature",100]); _currentState = [_currentWpn,_currentAnim,_temp]; if(DZE_FriendlySaving) then { - // save only last/most recent 5 entrys as we only have 200 chars in db field and weapon + animation names are sometimes really long 60-70 chars. + // save only last/most recent 5 entrys as we only have 200 chars in db field && weapon + animation names are sometimes really long 60-70 chars. _friendlies = [(_character getVariable ["friendlies",[]]),5] call array_reduceSizeReverse; _currentState set [(count _currentState),_friendlies]; }; @@ -177,10 +177,10 @@ if (_characterID != "0") then { if (count _playerPos > 0) then { _array = []; { - if (_x > dayz_minpos and _x < dayz_maxpos) then { + if (_x > dayz_minpos && _x < dayz_maxpos) then { _array set [count _array,_x]; }; - } forEach (_playerPos select 1); + } count (_playerPos select 1); _playerPos set [1,_array]; }; if (!isNull _character) then { @@ -206,7 +206,7 @@ if (_characterID != "0") then { _pos = _this select 0; { [_x, "gear"] call server_updateObject; - } forEach nearestObjects [_pos, dayz_updateObjects, 10]; + } count nearestObjects [_pos, dayz_updateObjects, 10]; //[_charPos] call server_updateNearbyObjects; //Reset timer diff --git a/SQF/dayz_server/compile/server_publishVehicle.sqf b/SQF/dayz_server/compile/server_publishVehicle.sqf index c758105b4..d634fe892 100644 --- a/SQF/dayz_server/compile/server_publishVehicle.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle.sqf @@ -37,7 +37,7 @@ if (_spawnDMG) then { _array set [count _array,[_selection,_dam]]; _totaldam = _totaldam + _dam; }; - } forEach _hitpoints; + } count _hitpoints; // just set low base dmg - may change later @@ -49,7 +49,7 @@ if (_spawnDMG) then { }; }; -// TODO: check if uid already exists and if so increment by 1 and check again as soon as we find nothing continue. +// TODO: check if uid already exists && if so increment by 1 && check again as soon as we find nothing continue. //Send request _key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, [], _array, _fuel,_uid]; @@ -104,9 +104,9 @@ PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; { _selection = _x select 0; _dam = _x select 1; - if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8}; + if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8}; [_object,_selection,_dam] call object_setFixServer; - } forEach _array; + } count _array; _object setFuel _fuel; diff --git a/SQF/dayz_server/compile/server_publishVehicle2.sqf b/SQF/dayz_server/compile/server_publishVehicle2.sqf index 4d0225a1f..e1f83faee 100644 --- a/SQF/dayz_server/compile/server_publishVehicle2.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle2.sqf @@ -28,7 +28,7 @@ _location = _worldspace select 1; //Generate UID test using time _uid = _worldspace call dayz_objectUID3; -// TODO: check if uid already exists and if so increment by 1 and check again as soon as we find nothing continue. +// TODO: check if uid already exists && if so increment by 1 && check again as soon as we find nothing continue. //Send request _key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, 0 , _characterID, _worldspace, [], [], 1,_uid]; diff --git a/SQF/dayz_server/compile/server_publishVehicle3.sqf b/SQF/dayz_server/compile/server_publishVehicle3.sqf index 73ac7979e..e0f875c2f 100644 --- a/SQF/dayz_server/compile/server_publishVehicle3.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle3.sqf @@ -9,7 +9,7 @@ _activatingPlayer = _this select 5; _characterID = _keySelected; _isOK = isClass(configFile >> "CfgVehicles" >> _class); -if(!_isOK or isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); }; +if(!_isOK || isNull _object) exitWith { diag_log ("HIVE-pv3: Vehicle does not exist: "+ str(_class)); }; diag_log ("PUBLISH: Attempt " + str(_object)); _dir = _worldspace select 0; @@ -96,7 +96,7 @@ _key call server_hiveWrite; { _object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Magazines _objWpnTypes = _magazines select 0; @@ -105,7 +105,7 @@ _key call server_hiveWrite; { _object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Backpacks _objWpnTypes = _backpacks select 0; @@ -114,7 +114,7 @@ _key call server_hiveWrite; { _object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; _object setVariable ["ObjectID", _oid, true]; diff --git a/SQF/dayz_server/compile/server_spawnCrashSite.sqf b/SQF/dayz_server/compile/server_spawnCrashSite.sqf index 8f11275d2..80871f455 100644 --- a/SQF/dayz_server/compile/server_spawnCrashSite.sqf +++ b/SQF/dayz_server/compile/server_spawnCrashSite.sqf @@ -115,11 +115,11 @@ while {1 == 1} do { diag_log(format["CRASHSPAWNER: Loot spawn at '%1' with loot table '%2'", _crashName, _lootTable]); - // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. + // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 && other such items. _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; { _x setVariable ["permaLoot",true]; - } forEach _nearBy; + } count _nearBy; }; }; diff --git a/SQF/dayz_server/compile/server_spawnEvent.sqf b/SQF/dayz_server/compile/server_spawnEvent.sqf index 3a44d4bf6..c5d33cb7a 100644 --- a/SQF/dayz_server/compile/server_spawnEvent.sqf +++ b/SQF/dayz_server/compile/server_spawnEvent.sqf @@ -26,7 +26,7 @@ epoch_eventIsAny = { }; if (!_boolReturn) exitWith {}; _index = _index + 1; - } forEach _event; + } count _event; _boolReturn }; @@ -54,7 +54,7 @@ while {1 == 1} do { diag_log ("RUNNING EVENT: " + (_x select 5) + " on " + _datestr); _handle = [] execVM "\z\addons\dayz_server\modules\" + (_x select 5) + ".sqf"; }; - } forEach EpochEvents; + } count EpochEvents; }; }; sleep 10; diff --git a/SQF/dayz_server/compile/server_swapObject.sqf b/SQF/dayz_server/compile/server_swapObject.sqf index d9dc88f3f..0cdb31dcf 100644 --- a/SQF/dayz_server/compile/server_swapObject.sqf +++ b/SQF/dayz_server/compile/server_swapObject.sqf @@ -38,7 +38,7 @@ if(_objectID == "0" && _objectUID == "0") then { }; _allowed = [_object, "Server"] call check_publishobject; -if (!_allowed or !_proceed) exitWith { +if (!_allowed || !_proceed) exitWith { if(!isNull(_object)) then { deleteVehicle _object; }; diff --git a/SQF/dayz_server/compile/server_updateObject.sqf b/SQF/dayz_server/compile/server_updateObject.sqf index c2e167f4f..0094f0c13 100644 --- a/SQF/dayz_server/compile/server_updateObject.sqf +++ b/SQF/dayz_server/compile/server_updateObject.sqf @@ -10,7 +10,7 @@ if(isNull(_object)) exitWith { }; _type = _this select 1; -_parachuteWest = ((typeOf _object == "ParachuteWest") or (typeOf _object == "ParachuteC")); +_parachuteWest = ((typeOf _object == "ParachuteWest") || (typeOf _object == "ParachuteC")); _isbuildable = (typeOf _object) in dayz_allowedObjects; _isNotOk = false; _firstTime = false; @@ -25,7 +25,7 @@ if ((typeName _objectID != "string") || (typeName _uid != "string")) then _objectID = "0"; _uid = "0"; }; -if (!_parachuteWest and !(locked _object)) then { +if (!_parachuteWest && !(locked _object)) then { if (_objectID == "0" && _uid == "0") then { _object_position = getPosATL _object; @@ -33,8 +33,8 @@ if (!_parachuteWest and !(locked _object)) then { }; }; -// do not update if buildable and not ok -if (_isNotOk and _isbuildable) exitWith { }; +// do not update if buildable && not ok +if (_isNotOk && _isbuildable) exitWith { }; // delete if still not ok if (_isNotOk) exitWith { deleteVehicle _object; diag_log(format["Deleting object %1 with invalid ID at pos [%2,%3,%4]",typeOf _object,_object_position select 0,_object_position select 1, _object_position select 2]); }; @@ -90,7 +90,7 @@ _object_damage = { _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name"); if (_hit > 0) then {_array set [count _array,[_selection,_hit]]}; _object setHit ["_selection", _hit]; - } forEach _hitpoints; + } count _hitpoints; _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage]; //diag_log ("HIVE: WRITE: "+ str(_key)); @@ -110,7 +110,7 @@ _object_killed = { if (_hit > 0) then {_array set [count _array,[_selection,_hit]]}; _hit = 1; _object setHit ["_selection", _hit]; - } forEach _hitpoints; + } count _hitpoints; if (_objectID == "0") then { _key = format["CHILD:306:%1:%2:%3:",_uid,_array,_damage]; @@ -145,7 +145,7 @@ _object_repair = { _selection = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "HitPoints" >> _x >> "name"); if (_hit > 0) then {_array set [count _array,[_selection,_hit]]}; _object setHit ["_selection", _hit]; - } forEach _hitpoints; + } count _hitpoints; _key = format["CHILD:306:%1:%2:%3:",_objectID,_array,_damage]; //diag_log ("HIVE: WRITE: "+ str(_key)); diff --git a/SQF/dayz_server/compile/server_weather.sqf b/SQF/dayz_server/compile/server_weather.sqf index bf391051f..024f8faf2 100644 --- a/SQF/dayz_server/compile/server_weather.sqf +++ b/SQF/dayz_server/compile/server_weather.sqf @@ -20,7 +20,7 @@ _numWeatherOptions = count _weatherOptions; // get inital weather forcast for the next 5 minutes _forcastTime = 300; -if (isNil "WeatherForcast" and isNil "WeatherForcastTime") then { +if (isNil "WeatherForcast" && isNil "WeatherForcastTime") then { WeatherForcast = floor(random(_numWeatherOptions)); WeatherForcastTime = diag_tickTime; } else { @@ -40,7 +40,7 @@ if (isNil "CurrentWeatherOption") then { CurrentWeatherOption = ((CurrentWeatherOption + 1) min _numWeatherOptions); } else { // start transition down if forcast is lower in the array than current weather - if (CurrentWeatherOption != WeatherForcast and WeatherForcastTime >= _forcastTime) then { + if (CurrentWeatherOption != WeatherForcast && WeatherForcastTime >= _forcastTime) then { CurrentWeatherOption = ((CurrentWeatherOption - 1) max 0) ; }; }; diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index ce3dc6eb1..60e21db52 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -39,7 +39,7 @@ server_updateNearbyObjects = { _pos = _this select 0; { [_x, "gear"] call server_updateObject; - } forEach nearestObjects [_pos, dayz_updateObjects, 10]; + } count nearestObjects [_pos, dayz_updateObjects, 10]; }; server_handleZedSpawn = { @@ -210,7 +210,7 @@ if(isnil "DynamicVehicleArea") then { DynamicVehicleArea = dayz_MapArea / 2; }; -// Get all buildings and roads only once TODO: set variables to nil after done if nessicary +// Get all buildings && roads only once TODO: set variables to nil after done if nessicary MarkerPosition = getMarkerPos "center"; RoadList = MarkerPosition nearRoads DynamicVehicleArea; @@ -230,7 +230,7 @@ BuildingList = []; }; -} forEach (MarkerPosition nearObjects ["building",DynamicVehicleArea]); +} count (MarkerPosition nearObjects ["building",DynamicVehicleArea]); spawn_vehicles = { private ["_random","_lastIndex","_weights","_index","_vehicle","_velimit","_qty","_isAir","_isShip","_position","_dir","_istoomany","_veh","_objPosition","_marker","_iClass","_itemTypes","_cntWeights","_itemType","_num","_allCfgLoots"]; @@ -251,7 +251,7 @@ spawn_vehicles = { if (_qty <= _velimit) exitWith {}; // vehicle limit reached, remove vehicle from list - // since elements cannot be removed from an array, overwrite it with the last element and cut the last element of (as long as order is not important) + // since elements cannot be removed from an array, overwrite it with the last element && cut the last element of (as long as order is not important) _lastIndex = (count AllowedVehiclesList) - 1; if (_lastIndex != _index) then { AllowedVehiclesList set [_index, AllowedVehiclesList select _lastIndex]; @@ -285,7 +285,7 @@ spawn_vehicles = { } else { - // Spawn around buildings and 50% near roads + // Spawn around buildings && 50% near roads if((random 1) > 0.5) then { waitUntil{!isNil "BIS_fnc_selectRandom"}; @@ -312,7 +312,7 @@ spawn_vehicles = { }; }; - // only proceed if two params otherwise BIS_fnc_findSafePos failed and may spawn in air + // only proceed if two params otherwise BIS_fnc_findSafePos failed && may spawn in air if ((count _position) == 2) then { _dir = round(random 180); @@ -350,12 +350,12 @@ spawn_vehicles = { if (DZE_MissionLootTable) then{ { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(missionConfigFile >> "cfgLoot" >> _iClass); + } count getArray(missionConfigFile >> "cfgLoot" >> _iClass); } else { { _itemTypes set[count _itemTypes, _x select 0] - } foreach getArray(configFile >> "cfgLoot" >> _iClass); + } count getArray(configFile >> "cfgLoot" >> _iClass); }; _index = dayz_CLBase find _iClass; @@ -595,7 +595,7 @@ dayz_objectUID2 = { _x = _x * 10; if ( _x < 0 ) then { _x = _x * -10 }; _key = _key + str(round(_x)); - } forEach _position; + } count _position; _key = _key + str(round(_dir)); _key }; @@ -609,7 +609,7 @@ dayz_objectUID3 = { _x = _x * 10; if ( _x < 0 ) then { _x = _x * -10 }; _key = _key + str(round(_x)); - } forEach _position; + } count _position; _key = _key + str(round(_dir + time)); _key }; @@ -673,7 +673,7 @@ dayz_perform_purge_player = { { _holder addWeaponCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; // add backpack magazine items _objWpnTypes = _backpackMag select 0; @@ -682,19 +682,19 @@ dayz_perform_purge_player = { { _holder addMagazineCargoGlobal [_x,(_objWpnQty select _countr)]; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; }; }; // add weapons { _holder addWeaponCargoGlobal [_x, 1]; - } forEach _weapons; + } count _weapons; // add mags { _holder addMagazineCargoGlobal [_x, 1]; - } forEach _magazines; + } count _magazines; _this removeAllMPEventHandlers "mpkilled"; _this removeAllMPEventHandlers "mphit"; @@ -769,10 +769,10 @@ server_spawncleanDead = { }; }; sleep 0.025; - } forEach _allDead; - if (_delQtyZ > 0 or _delQtyP > 0) then { + } count _allDead; + if (_delQtyZ > 0 || _delQtyP > 0) then { _qty = count _allDead; - diag_log (format["CLEANUP: Deleted %1 players and %2 zombies out of %3 dead",_delQtyP,_delQtyZ,_qty]); + diag_log (format["CLEANUP: Deleted %1 players && %2 zombies out of %3 dead",_delQtyP,_delQtyZ,_qty]); }; }; server_cleanupGroups = { @@ -784,7 +784,7 @@ server_cleanupGroups = { deleteGroup _x; }; sleep 0.001; - } forEach allGroups; + } count allGroups; DZE_DYN_GroupCleanup = nil; }; @@ -793,7 +793,7 @@ server_checkHackers = { if(!isNil "DZE_DYN_HackerCheck") exitWith { DZE_DYN_AntiStuck2nd = DZE_DYN_AntiStuck2nd + 1;}; DZE_DYN_HackerCheck = true; { - if (!((isNil "_x") OR {(isNull _x)})) then { + if (!((isNil "_x") || {(isNull _x)})) then { if(vehicle _x != _x && !(vehicle _x in PVDZE_serverObjectMonitor) && (isPlayer _x) && !((typeOf vehicle _x) in DZE_safeVehicle)) then { diag_log ("CLEANUP: KILLING A HACKER " + (name _x) + " " + str(_x) + " IN " + (typeOf vehicle _x)); (vehicle _x) setDamage 1; @@ -802,7 +802,7 @@ server_checkHackers = { }; }; sleep 0.001; - } forEach allUnits; + } count allUnits; DZE_DYN_HackerCheck = nil; }; @@ -817,7 +817,7 @@ server_spawnCleanFire = { _delQtyFP = _delQtyFP + 1; }; sleep 0.001; - } forEach _missionFires; + } count _missionFires; if (_delQtyFP > 0) then { _qty = count _missionFires; diag_log (format["CLEANUP: Deleted %1 fireplaces out of %2",_delQtyNull,_qty]); @@ -842,7 +842,7 @@ server_spawnCleanLoot = { } else { _age = (_dateNow - _created) * 525948; if (_age > 20) then { - _nearby = {(isPlayer _x) and (alive _x)} count (_x nearEntities [["CAManBase","AllVehicles"], 130]); + _nearby = {(isPlayer _x) && (alive _x)} count (_x nearEntities [["CAManBase","AllVehicles"], 130]); if (_nearby==0) then { deleteVehicle _x; sleep 0.025; @@ -852,7 +852,7 @@ server_spawnCleanLoot = { }; }; sleep 0.001; - } forEach _missionObjs; + } count _missionObjs; if (_delQty > 0) then { _qty = count _missionObjs; diag_log (format["CLEANUP: Deleted %1 Loot Piles out of %2",_delQty,_qty]); @@ -873,7 +873,7 @@ server_spawnCleanAnimals = { if (!alive _x) then { _pos = getPosATL _x; if (count _pos > 0) then { - _nearby = {(isPlayer _x) and (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 130]); + _nearby = {(isPlayer _x) && (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 130]); if (_nearby==0) then { _x call dayz_perform_purge; sleep 0.05; @@ -883,7 +883,7 @@ server_spawnCleanAnimals = { }; }; sleep 0.001; - } forEach _missonAnimals; + } count _missonAnimals; if (_delQtyAnimal > 0) then { _qty = count _missonAnimals; diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]); diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bandit.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bandit.sqf index b9e2e7685..ecd230ad8 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bandit.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bandit.sqf @@ -2,7 +2,7 @@ Bandit Vendor Seven Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bilgrad.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bilgrad.sqf index 02277f098..c98efcb01 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bilgrad.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/bilgrad.sqf @@ -2,7 +2,7 @@ Bilgrad Trader City Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/branibor.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/branibor.sqf index 26d60b88d..2c08093af 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/branibor.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/branibor.sqf @@ -2,7 +2,7 @@ Branibor Trader City Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/hero.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/hero.sqf index f587c7646..3a7d00ad1 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/hero.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/hero.sqf @@ -2,7 +2,7 @@ Hero Vendor Sevastopol Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/lyepestok.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/lyepestok.sqf index dd8d4d620..d4989b45a 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/lyepestok.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/lyepestok.sqf @@ -2,7 +2,7 @@ Lyepenstok Trader City Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/miscvendors.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/miscvendors.sqf index 88a41b09d..8fcc07c9e 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/miscvendors.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/miscvendors.sqf @@ -2,7 +2,7 @@ Misc. Vendors Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/sabina.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/sabina.sqf index 95a448757..f8d53ec5a 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/sabina.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/sabina.sqf @@ -2,7 +2,7 @@ Sabina Trader City Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/wholesalers.sqf b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/wholesalers.sqf index 3f3ee5f78..54ba5fccb 100644 --- a/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/wholesalers.sqf +++ b/SQF/dayz_server/missions/DayZ_Epoch_13.Tavi/wholesalers.sqf @@ -2,7 +2,7 @@ Wholesale Vendors Author: AVendettaForYou Date: 12/11/13 - If modified and released give credits where due thank you + If modified && released give credits where due thank you ---------------------------------------------------------------------------*/ if (isServer) then { diff --git a/SQF/dayz_server/modules/crash_spawner.sqf b/SQF/dayz_server/modules/crash_spawner.sqf index 3dee0a21f..c4e13097c 100644 --- a/SQF/dayz_server/modules/crash_spawner.sqf +++ b/SQF/dayz_server/modules/crash_spawner.sqf @@ -90,9 +90,9 @@ if (_spawnRoll <= _spawnChance) then { _itemType = _itemTypes select _index2; [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; }; - // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. + // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 && other such items. _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; { _x setVariable ["permaLoot",true]; - } forEach _nearBy; + } count _nearBy; }; \ No newline at end of file diff --git a/SQF/dayz_server/modules/supply_drop.sqf b/SQF/dayz_server/modules/supply_drop.sqf index 5ce05007a..d0d8947e1 100644 --- a/SQF/dayz_server/modules/supply_drop.sqf +++ b/SQF/dayz_server/modules/supply_drop.sqf @@ -57,9 +57,9 @@ if (_spawnRoll <= _spawnChance) then { [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot; }; - // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 and other such items. + // ReammoBox is preferred parent class here, as WeaponHolder wouldn't match MedBox0 && other such items. _nearby = _position nearObjects ["ReammoBox", sizeOf(_crashModel)]; { _x setVariable ["permaLoot",true]; - } forEach _nearBy; + } count _nearBy; }; \ No newline at end of file diff --git a/SQF/dayz_server/system/server_cleanup.fsm b/SQF/dayz_server/system/server_cleanup.fsm index 79f2a6d69..d8fa7aca2 100644 --- a/SQF/dayz_server/system/server_cleanup.fsm +++ b/SQF/dayz_server/system/server_cleanup.fsm @@ -18,7 +18,7 @@ item13[] = {"___min__loop",4,218,300.000000,-125.000000,400.000000,-75.000000,3. item14[] = {"___min_loop",4,218,450.000000,-125.000000,550.000000,-75.000000,4.000000,"5 min" \n "loop"}; item15[] = {"__0_min__loop",4,218,575.000000,-100.000000,675.000000,-50.000000,5.000000,"10 min" \n " loop"}; item16[] = {"__5_min__loop",4,218,700.000000,-75.000000,800.000000,-25.000000,6.000000,"15 min" \n " loop"}; -item17[] = {"cleanup_animals",2,250,700.000000,25.000000,800.000000,75.000000,0.000000,"cleanup" \n "animals and fire"}; +item17[] = {"cleanup_animals",2,250,700.000000,25.000000,800.000000,75.000000,0.000000,"cleanup" \n "animals && fire"}; item18[] = {"cleanup_dead",2,250,575.000000,0.000000,675.000000,50.000000,0.000000,"cleanup" \n "dead"}; item19[] = {"sync_time",2,250,450.000000,-25.000000,550.000000,25.000000,0.000000,"sync time"}; item20[] = {"cleanup_loot",2,250,300.000000,-25.000000,400.000000,25.000000,0.000000,"cleanup" \n "loot"}; @@ -342,7 +342,7 @@ class FSM init = /*%FSM*/"{" \n " needUpdate_objects = needUpdate_objects - [_x];" \n " [_x,""damage"",true] call server_updateObject;" \n - "} forEach needUpdate_objects;"/*%FSM*/; + "} count needUpdate_objects;"/*%FSM*/; precondition = /*%FSM*/""/*%FSM*/; class Links { diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index aa2bed504..f7b28dd06 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -27,7 +27,7 @@ if(isnil "MaxMineVeins") then { }; // Custon Configs End -if (isServer and isNil "sm_done") then { +if (isServer && isNil "sm_done") then { serverVehicleCounter = []; _hiveResponse = []; @@ -80,7 +80,7 @@ if (isServer and isNil "sm_done") then { _vQty = _vQty + 1; }; }; - diag_log ("HIVE: got " + str(_bQty) + " Epoch Objects and " + str(_vQty) + " Vehicles"); + diag_log ("HIVE: got " + str(_bQty) + " Epoch Objects && " + str(_vQty) + " Vehicles"); }; // # NOW SPAWN OBJECTS # @@ -171,7 +171,7 @@ if (isServer and isNil "sm_done") then { }; // Test disabling simulation server side on buildables only. _object enableSimulation false; - // used for inplace upgrades and lock/unlock of safe + // used for inplace upgrades && lock/unlock of safe _object setVariable ["OEMPos", _pos, true]; }; @@ -197,7 +197,7 @@ if (isServer and isNil "sm_done") then { _object addWeaponCargoGlobal [_x,(_objWpnQty select _countr)]; }; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Magazines _objWpnTypes = (_intentory select 1) select 0; @@ -211,7 +211,7 @@ if (isServer and isNil "sm_done") then { _object addMagazineCargoGlobal [_x,(_objWpnQty select _countr)]; }; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; //Add Backpacks _objWpnTypes = (_intentory select 2) select 0; @@ -223,7 +223,7 @@ if (isServer and isNil "sm_done") then { _object addBackpackCargoGlobal [_x,(_objWpnQty select _countr)]; }; _countr = _countr + 1; - } forEach _objWpnTypes; + } count _objWpnTypes; }; }; @@ -231,9 +231,9 @@ if (isServer and isNil "sm_done") then { { _selection = _x select 0; _dam = _x select 1; - if (_selection in dayZ_explosiveParts and _dam > 0.8) then {_dam = 0.8}; + if (_selection in dayZ_explosiveParts && _dam > 0.8) then {_dam = 0.8}; [_object,_selection,_dam] call object_setFixServer; - } forEach _hitpoints; + } count _hitpoints; _object setFuel _fuel; @@ -242,7 +242,7 @@ if (isServer and isNil "sm_done") then { //_object setvelocity [0,0,1]; _object call fnc_veh_ResetEH; - if(_ownerID != "0" and !(_object isKindOf "Bicycle")) then { + if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then { _object setvehiclelock "locked"; }; @@ -256,7 +256,7 @@ if (isServer and isNil "sm_done") then { //Monitor the object PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; }; - } forEach (_BuildingQueue + _objectQueue); + } count (_BuildingQueue + _objectQueue); // # END SPAWN OBJECTS # // preload server traders menu data into cache @@ -293,9 +293,9 @@ if (isServer and isNil "sm_done") then { //diag_log ("HIVE: Streamed " + str(_val) + " objects"); }; - } forEach (_traderData select 0); + } count (_traderData select 0); }; - } forEach serverTraders; + } count serverTraders; }; if (_hiveLoaded) then {