Remove some redundant checks

Vanilla commits:

da7061429a

da55eaa53e
This commit is contained in:
ebaydayz
2017-01-29 19:36:48 -05:00
parent 3224a21363
commit 8c1caa9c1c
19 changed files with 33 additions and 25 deletions

View File

@@ -20,7 +20,9 @@
[CHANGED] AntiTP and scheduled security are now fully disabled when dayz_antihack=0. #1816
[CHANGED] Changed default value for the variable dayz_bleedingeffect to 2 (blood particle effect only) due to negative FPS impact. Set to 3 to enable blood stains again. #1816
[CHANGED] Group icons have been moved to a slower loop and the group system is disabled by default. See configVariables.sqf to enable. #1816
[CHANGED] Flies are now disabled by default due to negative FPS impact. See init.sqf to enable. #1816
[CHANGED] Flies now spawn ten minutes after death instead of right away. Flies are also disabled by default due to negative FPS impact. See init.sqf to enable. #1816
[CHANGED] Increased head shot damage for normal hits (non-zombie and non-melee)
[CHANGED] Slightly increased damage from vehicle run over
[FIXED] Wrong texture for z_hunter zombie. #1805 @schwanzkopfhegel @ebayShopper
[FIXED] Refuel with generator at gas station not working. #1806 @Helios27 @ebayShopper
@@ -71,6 +73,7 @@
[FIXED] Bandit1_DZ and Bandit2_DZ were the same. Bandit1_DZ is back to the normal non-camo skin now. #1874 @DeVloek
[FIXED] If a player force kills their game immediately after dying their body will no longer disappear. #1825 @looter809
[FIXED] Some AI behavior was broken due to RadioProtocolEmpty. Unfortunately this reintroduces group chat spam.
[FIXED] You can no longer pack your tent while sleeping.
[NOTE] The fixes below are included in the 1.0.6 Build C server package released December 29th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade

View File

@@ -103,7 +103,7 @@ _enoughMoney = false;
_moneyInfo = [false, [], [], [], 0];
if (Z_SingleCurrency) then {
_enoughMoney = if (_wealth >= _priceToBuy) then { true } else { false };
_enoughMoney = (_wealth >= _priceToBuy);
} else {
_moneyInfo = _priceToBuy call Z_canAfford;
_enoughMoney = _moneyInfo select 0;
@@ -212,7 +212,7 @@ if (_enoughMoney) then {
if (_x select 1 == "trade_weapons") then {
_count = 0;
while {_count < (_x select 9)} do {
_hasPrimary = if (primaryWeapon player != "") then {true} else {false};
_hasPrimary = (primaryWeapon player != "");
if (_hasPrimary && getNumber (configFile >> "CfgWeapons" >> (_x select 0) >> "type") == 1) then {
dayz_onBack = _x select 0; //Add to back
} else {

View File

@@ -16,7 +16,7 @@ a_player_boil = true;
player removeAction s_player_boil;
//s_player_boil = -1;
//_bottleInfected = if ("ItemWaterBottleInfected" in magazines player) then {true} else {false};
//_bottleInfected = ("ItemWaterBottleInfected" in magazines player);
/* //canteens are metal, we only use canteens in Epoch
_hastinitem = false;
@@ -25,7 +25,7 @@ _hastinitem = false;
if (_x in magazines player) exitWith {_hastinitem = true;};
} count boil_tin_cans;
if (!_hastinitem) exitWith {format[localize "str_player_31",_tintext,localize "str_player_31_fill"] call dayz_rollingMessages; a_player_boil = false;};
if (!_hastinitem) exitWith {format[localize "str_player_31",_tintext,localize "str_player_31_fill"] call dayz_rollingMessages; a_player_boil = false; dayz_actionInProgress = false;};
*/
if (_qty > 0) then {
player playActionNow "Medic";

View File

@@ -64,7 +64,7 @@ _maintain = {
_wealth = player getVariable[Z_MoneyVariable,0];
if (Z_SingleCurrency) then {
_enoughMoney = if (_wealth >= _amount) then { true } else { false };
_enoughMoney = (_wealth >= _amount);
} else {
Z_Selling = false; // Initialize gem currency before Z_canAfford.
_moneyInfo = _amount call Z_canAfford;

View File

@@ -34,7 +34,7 @@ if (_classname isKindOf "TrapBear") exitWith { deleteVehicle _holder; };
player playActionNow "PutDown";
//Adding random chance of arrow is re-usable on pickup
_broken = if ((_classname == "1Rnd_Arrow_Wood") && {[0.15] call fn_chance}) then {true} else {false};
_broken = ((_classname == "1Rnd_Arrow_Wood") && {[0.15] call fn_chance});
if (_broken) exitWith { deleteVehicle _holder; localize "str_broken_arrow" call dayz_rollingMessages; };
_claimedBy = _holder getVariable["claimed","0"];

View File

@@ -74,7 +74,6 @@ if (_hasInput) then {
player playActionNow "PutDown";
//Hack to get craft menu to use build needs a good tidy up
[_orignalClass,"Build","ItemActions"] spawn player_build;
dayz_actionInProgress = true;
[_orignalClass,"Build","ItemActions"] spawn player_build;
};
};

View File

@@ -44,7 +44,7 @@ if (_byPassChecks == "") then { _byPassChecks = "BaseItems" };
if (_ghost == "") then { _ghost = _classname; };
//Remove tents and stashes from new collision system until we find a better way then build tent for hiding items.
_isCollisionBypass = if (isText (configFile >> _isClass >> _item >> _classType >> _action >> "bypassCollision")) then { true } else { false };
_isCollisionBypass = (isText (configFile >> _isClass >> _item >> _classType >> _action >> "bypassCollision"));
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_keepOnSlope = 0 == (getNumber (configFile >> "CfgVehicles" >> _classname >> "canbevertical"));

View File

@@ -74,7 +74,7 @@ if (_canDo) then {
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
_selectedRecipeInputStrict = if ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && (getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0)) then {true} else {false};
_selectedRecipeInputStrict = ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && (getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0));
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");

View File

@@ -6,7 +6,7 @@ _config = configFile >> "CfgWeapons" >> _item;
_droppedType = getText (_config >> "droppeditem");
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith { localize "str_player_21" call dayz_rollingMessages; dayz_actionInProgress = false; };
if (_onLadder) exitWith { localize "str_player_21" call dayz_rollingMessages; };
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;

View File

@@ -1,3 +1,6 @@
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_playArray","_lastRest","_blood","_timesincedrink","_bloodinc","_Moves","_sleepArray","_animState","_started","_finished","_timer","_i","_r","_cureAttempt","_isAsleep","_cureChance","_infectedStatus","_randomamount","_isOwner","_tent"];
//_timesincedrink = time - dayz_lastDrink;
//_bloodinc =100; Removed for now(untested) due to it not needed yet
@@ -11,7 +14,7 @@ player playmove "AidlPpneMstpSnonWnonDnon_SleepC_sleep";
_sleeping = player getVariable ["sleeping",false];
if (_sleeping) exitwith {};
if (_sleeping) exitWith {dayz_actionInProgress = false;};
player setVariable ["sleeping",true];
@@ -105,6 +108,7 @@ if (r_interrupt) then {
};
player setVariable ["sleeping",false];
dayz_actionInProgress = false;
//Removed due to player sync returning []
//PVDZ_plr_Save = [player,nil,true,dayz_playerAchievements];

View File

@@ -1,5 +1,5 @@
scriptName "Functions\misc\fn_damageActions.sqf";
if (dayz_actionInProgress) exitWith {};
#include "\z\addons\dayz_code\util\array.hpp";
/***********************************************************

View File

@@ -4,7 +4,6 @@ scriptName "Functions\misc\fn_selfActions.sqf";
- Function
- [] call fnc_usec_selfActions;
************************************************************/
if (dayz_actionInProgress) exitWith {};
private ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names",
"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnitors","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",

View File

@@ -43,7 +43,7 @@ _difference = 0;
_isinbuilding = false;
_isinvehicle = false;
_raining = if(rain > 0) then {true} else {false};
_raining = (rain > 0);
_sunrise = call world_sunRise;
//POSITIV EFFECTS

View File

@@ -23,9 +23,9 @@ if (time - dayz_lastCheckSave > 10) then {
while {(!isNull _display) && !r_player_dead} do {
_timeout = 30;
_timeout = player getVariable["combattimeout", 0];
_inCombat = if (_timeout >= diag_tickTime) then {true} else {false};
_playerCheck = if ({isPlayer _x} count (player nearEntities ["AllVehicles",5]) > 1) then {true} else {false};
_zedCheck = if ((count (player nearEntities ["zZombie_Base",10]) > 0) && !_isPZombie) then {true} else {false};
_inCombat = (_timeout >= diag_tickTime);
_playerCheck = ({isPlayer _x} count (player nearEntities ["AllVehicles",5]) > 1);
_zedCheck = ((count (player nearEntities ["zZombie_Base",10]) > 0) && !_isPZombie);
_gearDisplay = findDisplay 106;
if (!isNull _gearDisplay) then {
_gearDisplay closeDisplay 0;

View File

@@ -2,8 +2,11 @@
sched_playerActions = {
HIDE_FSM_VARS
call fnc_usec_selfActions;
call fnc_usec_damageActions;
if (!dayz_actionInProgress) then {
call fnc_usec_selfActions;
call fnc_usec_damageActions;
};
//combat check
if ((player getVariable ["combattimeout",0] < diag_tickTime) && {player getVariable ["inCombat",false]}) then {

View File

@@ -129,7 +129,7 @@ if (!_isNew) then {
};
};
_isHiveOk = if (_hiveVer >= dayz_hiveVersionNo) then {true} else {false}; //EDITED
_isHiveOk = (_hiveVer >= dayz_hiveVersionNo); //EDITED
/*
if (count _inventory > 2 && {typeName (_inventory select 2) != "STRING"}) then {

View File

@@ -178,7 +178,7 @@ if (count _stats > 0) then {
if (_randomSpot) then {
private ["_counter","_position","_isNear","_isZero","_mkr"];
if (!isDedicated) then {endLoadingScreen;};
_IslandMap = if (toLower worldName in ["caribou","cmr_ovaron","dayznogova","dingor","dzhg","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tasmania2010","tavi","trinity","utes"]) then {true} else {false};
_IslandMap = (toLower worldName in ["caribou","cmr_ovaron","dayznogova","dingor","dzhg","fallujah","fapovo","fdf_isle1_a","isladuala","lingor","mbg_celle2","namalsk","napf","oring","panthera2","sara","sauerland","smd_sahrani_a2","tasmania2010","tavi","trinity","utes"]);
//spawn into random
_findSpot = true;

View File

@@ -151,7 +151,7 @@ if (count _this > 4) then { //calling from player_onDisconnect
};
if (_isInVehicle) then {
//if the player object is inside a vehicle lets eject the player
_relocate = if ((vehicle _character isKindOf "Air") && (_charPos select 2 > 1.5)) then {true} else {false};
_relocate = ((vehicle _character isKindOf "Air") && (_charPos select 2 > 1.5));
_character action ["eject", vehicle _character];
// Prevent relog in parachute, heli or plane above base exploit to get inside

View File

@@ -23,7 +23,7 @@ _hasfireffect = false;
_isinbuilding = false;
_isinvehicle = false;
_raining = if(rain > 0) then {true} else {false};
_raining = (rain > 0);
_sunrise = call world_sunRise;
//POSITIV EFFECTS