diff --git a/CHANGE LOG 1.0.6.1.txt b/CHANGE LOG 1.0.6.1.txt index 0517ac542..90f3812a9 100644 --- a/CHANGE LOG 1.0.6.1.txt +++ b/CHANGE LOG 1.0.6.1.txt @@ -39,6 +39,7 @@ [FIXED] Filling fuel barrels takes the correct amount from fuel tanks now (210 instead of 40 litres). #1834 @schwanzkopfhegel @oiad [FIXED] Base objects duplicating when using "take ownership" on plot pole. #1811 @BNG-Lance @Clanwarfare [FIXED] Unable to sell some launchers like Javelin and Stinger which have the same classname for ammo and weapon. #1844 @ndavalos +[FIXED] Long search delay when filling water bottles, drinking from hands and drinking from empty cans on Chernarus. #1835 @schwanzkopfhegel [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 diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildings/Land_pumpa.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildings/Land_pumpa.hpp deleted file mode 100644 index 1a7971b59..000000000 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildings/Land_pumpa.hpp +++ /dev/null @@ -1,19 +0,0 @@ -class Land_pumpa: House -{ - class UserActions - { - class Drink - { - displayName = $STR_ACTIONS_DRINK2; - displayNameDefault = $STR_ACTIONS_DRINK2; - priority = 3; - radius = 3; - position = ""; - showWindow = 1; - onlyForPlayer = 1; - shortcut = ""; - condition = "(['Drink',this] call userActionConditions)"; - statement = "'hands' spawn player_drinkWater;"; - }; - }; -}; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildings/WaterSources.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildings/WaterSources.hpp new file mode 100644 index 000000000..9a23043f4 --- /dev/null +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildings/WaterSources.hpp @@ -0,0 +1,39 @@ +class Land_pumpa: House +{ + class UserActions + { + class Drink + { + displayName = $STR_ACTIONS_DRINK2; + displayNameDefault = $STR_ACTIONS_DRINK2; + priority = 3; + radius = 3; + position = ""; + showWindow = 1; + onlyForPlayer = 1; + shortcut = ""; + condition = "(['Drink',this] call userActionConditions)"; + statement = "'Land_pumpa' spawn player_drinkWater;"; + }; + }; +}; + +class Land_Barrel_water: Thing +{ + class UserActions + { + class Drink + { + displayName = $STR_ACTIONS_DRINK2; + displayNameDefault = $STR_ACTIONS_DRINK2; + priority = 3; + radius = 3; + position = ""; + showWindow = 1; + onlyForPlayer = 1; + shortcut = ""; + condition = "(['Drink',this] call userActionConditions)"; + statement = "'Land_Barrel_water' spawn player_drinkWater;"; + }; + }; +}; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp b/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp index 74b3b120c..e3a95b95e 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp @@ -457,6 +457,7 @@ class CfgVehicles { class SpawnableWreck : House {}; class Strategic; class NonStrategic; + class Thing; // class Land_Fire; class BuiltItems; class Building; @@ -578,7 +579,7 @@ class CfgVehicles { #include "Buildings\Land_telek1.hpp" #include "Buildings\Land_VASICore.hpp" #include "Buildings\Land_Vysilac_FM.hpp" - #include "Buildings\Land_pumpa.hpp" + #include "Buildings\WaterSources.hpp" //Duplicates of Epoch items in DZE\Prop_Defs.hpp //#include "CamoNetting.hpp" diff --git a/SQF/dayz_code/actions/player_drinkWater.sqf b/SQF/dayz_code/actions/player_drinkWater.sqf index 0ed3696ee..d8e685a14 100644 --- a/SQF/dayz_code/actions/player_drinkWater.sqf +++ b/SQF/dayz_code/actions/player_drinkWater.sqf @@ -1,61 +1,26 @@ -private ["_playerPos","_canFill","_isPond","_isWell","_pondPos","_objectsWell","_onLadder","_hasbottleitem","_config","_item","_text","_objectsPond","_qty","_dis","_sfx","_isInfected","_bodiesNear","_chance","_itemorignal","_well"]; +private ["_canFill","_onLadder","_chance","_posASL","_posATL"]; call gear_ui_init; closeDialog 0; -_item = _this; -_playerPos = getPosATL player; -_canFill = count nearestObjects [_playerPos, ["Land_pumpa","Land_water_tank"], 4] > 0; -_isPond = false; -_isWell = false; -_isInfected = false; -_pondPos = []; -_objectsWell = []; _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; if (_onLadder) exitWith {localize "str_player_21" call dayz_rollingMessages;}; -_itemorignal = _this; -//diag_log(str(_itemorignal)); +_posASL = getPosASL player; +_posATL = ASLtoATL _posASL; -if (!dayz_isSwimming) then { - player playActionNow "PutDown"; +_canFill = switch true do { + //Return: [nearWaterHole, isPond] + case (count nearestObjects [_posATL,["Land_pumpa","Land_Barrel_water"],4] > 0): {[true,false]}; //"Land_water_tank" has no spout or opening, doesn't make sense to include + case (toLower worldName == "chernarus"): {(call fn_nearWaterHole)}; + //Slow searches for maps without waterHoleProxy objects added yet + case ({["_well",str _x] call fnc_inString} count nearestObjects [_posATL,[],4] > 0): {[true,false]}; + case ({["pond",str _x] call fnc_inString && {_posASL select 2 < ((getPosASL _x) select 2)}} count nearestObjects [player,[],50] > 0): {[true,true]}; + default {[false,false]}; }; -if (!_canFill) then { - _objectsWell = nearestObjects [_playerPos, [], 4]; - { - //Check for Well - _isWell = ["_well",str(_x),false] call fnc_inString; - if (_isWell) then {_canFill = true}; - } forEach _objectsWell; -}; - -if (!_canFill) then { - _objectsPond = nearestObjects [_playerPos, [], 100]; - { - //Check for pond - _isPond = ["pond",str(_x),false] call fnc_inString; - //Check for Dead Bodies - _bodiesNear = ["dead",str(_x),false] call fnc_inString; - if (!_bodiesNear) then { - _bodiesNear = ["massgrave",str(_x),false] call fnc_inString; - }; - if (_bodiesNear) then { - _isInfected = true; - }; - if (_isPond) then { - _pondPos = (_x worldToModel _playerPos) select 2; - if (_pondPos < 0) then { - _canFill = true; - }; - }; - } forEach _objectsPond; -}; - -if (_canFill) then { - _chance = 0.1; - - if (_itemorignal in boil_tin_cans) then { +if (_canFill select 0) then { + if (_this in boil_tin_cans) then { _chance = 0.06; ["FoodDrink",0,[0,0,300,0]] call dayz_NutritionSystem; //[Energy,food,water,temp] } else { @@ -63,20 +28,22 @@ if (_canFill) then { ["FoodDrink",0,[0,0,150,0]] call dayz_NutritionSystem; //[Energy,food,water,temp] }; - [player,"drink",0,false,5] call dayz_zombieSpeak; - [player,10,true,(getPosATL player)] call player_alertZombies; + if (!dayz_isSwimming) then { + player playActionNow "PutDown"; + }; - if(!_isWell) then { - if (_isInfected) then { + [player,"drink",0,false,5] call dayz_zombieSpeak; + [player,10,true,_posATL] call player_alertZombies; + + //Check if water source is infected only for ponds + if (dayz_infectiousWaterholes && {_canFill select 1} && {count nearestObjects [_posATL,["Body","Body1","Body2","Mass_grave"],50] > 0}) then { + r_player_infected = true; + } else { + if ([_chance] call fn_chance) then { r_player_infected = true; - player setVariable["USEC_infected",true,true]; - } else { - if ([_chance] call fn_chance) then { - r_player_infected = true; - player setVariable["USEC_infected",true,true]; - }; }; }; + localize "str_drinkwithhands" call dayz_rollingMessages; } else { localize "str_player_32" call dayz_rollingMessages; diff --git a/SQF/dayz_code/actions/water_fill.sqf b/SQF/dayz_code/actions/water_fill.sqf index d8bf79b07..ac2add5e2 100644 --- a/SQF/dayz_code/actions/water_fill.sqf +++ b/SQF/dayz_code/actions/water_fill.sqf @@ -1,67 +1,31 @@ #include "\z\addons\dayz_code\util\player.hpp" -private ["_water","_filled","_canFill","_infected","_well"]; +private ["_canFill","_water","_filled","_posASL","_posATL"]; call gear_ui_init; closeDialog 0; if Player_IsOnLadder() exitWith { (localize "str_player_21") call dayz_rollingMessages; }; -_water = call -{ - private ["_canFill", "_infected"]; - - _canFill = count nearestObjects [player, ["Land_pumpa","Land_water_tank","Land_Barrel_water"], 4] > 0; - - if (_canFill) exitWith { "safe" }; - - //Check for wells - { - if (["_well", str _x, false] call fnc_inString) exitWith - { - _canFill = true; - }; - } - foreach nearestObjects [player, [], 4]; - - if (_canFill) exitWith { "safe" }; - - _infected = false; - - //Check for ponds and corpses - { - if (!_canFill) then - { - if (["pond", str _x, false] call fnc_inString && {((getPosASL player) select 2) < ((GetPosASL _x) select 2)}) then - { - _canFill = true; - }; - }; - - if (!_infected) then - { - if (["dead", str _x, false] call fnc_inString || {["massgrave", str _x, false] call fnc_inString}) then - { - _infected = true; - }; - }; - - if (_canFill && {_infected}) exitWith {}; - } - foreach nearestObjects [player, [], 50]; - - if (!_canFill) exitWith { nil }; - - if (_infected) exitWith { "infected" }; - - "" +_posASL = getPosASL player; +_posATL = ASLtoATL _posASL; + +_canFill = switch true do { + //Return: [nearWaterHole, isPond] + case (count nearestObjects [_posATL,["Land_pumpa","Land_Barrel_water"],4] > 0): {[true,false]}; //"Land_water_tank" has no spout or opening, doesn't make sense to include + case (toLower worldName == "chernarus"): {(call fn_nearWaterHole)}; + //Slow searches for maps without waterHoleProxy objects added yet + case ({["_well",str _x] call fnc_inString} count nearestObjects [_posATL,[],4] > 0): {[true,false]}; + case ({["pond",str _x] call fnc_inString && {_posASL select 2 < ((getPosASL _x) select 2)}} count nearestObjects [player,[],50] > 0): {[true,true]}; + default {[false,false]}; }; -if (isNil "_water") exitWith -{ - (localize "str_player_20") call dayz_rollingMessages; +if !(_canFill select 0) exitWith { + localize "str_player_20" call dayz_rollingMessages; }; +//Check if water source is infected only for ponds +_water = if (dayz_infectiousWaterholes && {_canFill select 1} && {count nearestObjects [_posATL,["Body","Body1","Body2","Mass_grave"],50] > 0}) then {"infected"} else {"safe"}; _water = "containerwater" + _water; _filled = 0; @@ -74,9 +38,6 @@ _filled = 0; { player playActionNow "PutDown"; }; - - [player, "fillwater", 0, false, 5] call dayz_zombieSpeak; - [player, 5, true, getPosATL player] call player_alertZombies; }; _filled = _filled + 1; @@ -87,6 +48,10 @@ _filled = 0; } foreach magazines player; -if (_filled > 0) -then { (format [localize "str_player_01", _filled]) call dayz_rollingMessages; } -else { (localize "str_player_02") call dayz_rollingMessages; }; \ No newline at end of file +if (_filled > 0) then { + [player, "fillwater", 0, false, 5] call dayz_zombieSpeak; + [player, 5, true, _posATL] call player_alertZombies; + format [localize "str_player_01", _filled] call dayz_rollingMessages; +} else { + localize "str_player_02" call dayz_rollingMessages; +}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_nearWaterHole.sqf b/SQF/dayz_code/compile/fn_nearWaterHole.sqf index a011c5d35..0ffbd1ece 100644 --- a/SQF/dayz_code/compile/fn_nearWaterHole.sqf +++ b/SQF/dayz_code/compile/fn_nearWaterHole.sqf @@ -1,6 +1,6 @@ -private ["_bb","_dir","_nearWaterHole","_w2m"]; +private ["_bb","_dir","_nearWaterHole","_pond","_well","_w2m"]; -_nearWaterHole = false; +_nearWaterHole = [false,false]; { { @@ -12,13 +12,15 @@ _nearWaterHole = false; _dir = _dir - 360; }; - if ((abs _dir < 45 && {_x distance player < 2.22}) // wells, kasna, pumpa - or {("" == typeOf _x && (_w2m select 2 < 0.05)) && {(abs(_w2m select 0) < (_bb select 0)) && (abs(_w2m select 1) < (_bb select 1))}}) exitWith { // ponds - _nearWaterHole = true; + _well = (abs _dir < 45 && {_x distance player < 2.22}); // wells, kasna, pumpa + _pond = (("" == typeOf _x && (_w2m select 2 < 0.05)) && {(abs(_w2m select 0) < (_bb select 0)) && (abs(_w2m select 1) < (_bb select 1))}); + + if (_well or _pond) exitWith { + _nearWaterHole = [true,_pond]; }; } count (nearestObjects [_x, [], 1]); - if (_nearWaterHole) exitWith {}; + if (_nearWaterHole select 0) exitWith {}; } forEach (nearestObjects [player, ["waterHoleProxy"], 50]); _nearWaterHole \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 7011d56ac..0955781c9 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -99,9 +99,9 @@ if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVe /* //FPS killer. Moved to CfgVehicles for Land_pumpa -if (_canDo && !_inVehicle && !dayz_isSwimming && (call fn_nearWaterHole)) then { +if (_canDo && !_inVehicle && !dayz_isSwimming && ((call fn_nearWaterHole) select 0)) then { if (s_player_Drinkfromhands < 0) then { - s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf",player, 0.5, false, true]; + s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf","hands", 0.5, false, true]; }; } else { if (s_player_Drinkfromhands >= 0) then { diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index 7ec45d866..ce1437f92 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -34,7 +34,7 @@ if (isNil "keyboard_keys") then { dayz_autoRunThread = [] spawn { while {dayz_autoRun} do { // SurfaceIsWater does not work for ponds - if (player != vehicle player or (surfaceIsWater getPosASL player) or (call fn_nearWaterHole) or r_fracture_legs) exitWith { + if (player != vehicle player or (surfaceIsWater getPosASL player) or ((call fn_nearWaterHole) select 0) or r_fracture_legs) exitWith { call dayz_autoRunOff; }; player playAction "FastF"; diff --git a/Server Files/Battleye/scripts.txt b/Server Files/Battleye/scripts.txt index 115e7a4df..a8a345728 100644 --- a/Server Files/Battleye/scripts.txt +++ b/Server Files/Battleye/scripts.txt @@ -51,4 +51,4 @@ 5 sideLogic !"{ \nBIS_MPF_ServerInitDone = true;\ncreatecenter sidelogic;\nBIS_MPF_dummygroup = createGroup sideLogic;" !"{ \nBIS_MPF_ServerInitDone = true;\ncreatecenter sidelogic;\n\n\nBIS_MPF_dummygroup = createGroup sideLogic;" 5 switchCamera !"\"switchCamera\", \n\n\n\"fadeMusic\"," !="rswitchCamera = 'switchCamera'" !"rswitchCameracode" !"\"switchCamera\", \"taskHint\"," !="player switchCamera (Dayz_constructionContext select 2);" !="player switchCamera _currentCamera;" 5 toString !="_skinToModel = toString (_finalArray);" !="{_textArrayTemp = _textArrayTemp + [tostring [_x]]} foreach _line;" !="_cmpt = toString _cmpt;" !="_objName = toLower(toString(_objName));" !"if (toString _hayArr != _needle) then {" !="_type = toString _typeA;" !="_anim4 = toString _anim4;" !"{(count _stance>17)}) then {toString [_stance select 17]}" !="lbAdd [7102, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !="lbAdd [7002, if (typeName _name == \"ARRAY\") then {toString _name} else {_name}];" !"if (isnil 'BIS_fnc_timeToString' || false) then {" -5 worldTo !"ect 1;\n_inside = false;\n_offset = 1; \n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _" !"\n\n_new = getPosATL _obj;\n\nif (_isPlayer) then {\n_x = _pos worldToModel _new;\n_dir = _dir + (if ((_x select 1)==0) then { 0 } else" !"_pondPos = (_x worldToModel _playerPos) select 2;\n" !"ts [_new, [], 100];\n{\nif (((typeOf(_x) == \"\")\nAND {((((_x worldToModel _new) select 2) < 0))\nAND {([_x, _new] call _checkPerimete" !"t = _this select 1;\n_inside = false;\n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _bou" !"fascl,getDir _x,\"\",1];if(_fash==_forEachIndex)then{_fapos2D=worldtoscreen _fapos;if(count _fapos2D>=2)then{_fasp ctrlsetposition" !"_pondPos = (_x worldToModel _playerPos) select 2;\nif (_pondPos < 0) then {\n_canFill" !"_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;" !"_bn == 1) then { \n_bb = boundingBox _o;\n_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);\n_p = [ (_bb select 0) select" !"if (_distance > 1 && _distance < 2500) then {\n_pos set [2,(_pos select 2) + 1.5];\n_screen = worldToScreen _pos;\n_text = composeText [image" \ No newline at end of file +5 worldTo !"ect 1;\n_inside = false;\n_offset = 1; \n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _" !"\n\n_new = getPosATL _obj;\n\nif (_isPlayer) then {\n_x = _pos worldToModel _new;\n_dir = _dir + (if ((_x select 1)==0) then { 0 } else" !"ts [_new, [], 100];\n{\nif (((typeOf(_x) == \"\")\nAND {((((_x worldToModel _new) select 2) < 0))\nAND {([_x, _new] call _checkPerimete" !"t = _this select 1;\n_inside = false;\n\n_relPos = _building worldToModel _point;\n_boundingBox = boundingBox _building;\n\n_min = _bou" !"fascl,getDir _x,\"\",1];if(_fash==_forEachIndex)then{_fapos2D=worldtoscreen _fapos;if(count _fapos2D>=2)then{_fasp ctrlsetposition" !"_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;" !"_bn == 1) then { \n_bb = boundingBox _o;\n_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);\n_p = [ (_bb select 0) select" !"if (_distance > 1 && _distance < 2500) then {\n_pos set [2,(_pos select 2) + 1.5];\n_screen = worldToScreen _pos;\n_text = composeText [image" \ No newline at end of file