Stop autoRun and remove drink from hands at ponds #1827

Fixes #1827
This commit is contained in:
ebaydayz
2016-12-22 21:52:22 -05:00
parent f1b991acd2
commit 4d3f707417
12 changed files with 74 additions and 34 deletions

View File

@@ -3,6 +3,7 @@
[CHANGED] Added NWAF tent camp to Chernarus points of interests and removed trains POI for now. [CHANGED] Added NWAF tent camp to Chernarus points of interests and removed trains POI for now.
[CHANGED] Turbo and HoldBreath keybindings are now allowed again. @icomrade [CHANGED] Turbo and HoldBreath keybindings are now allowed again. @icomrade
[CHANGED] Removed drink from hands at ponds due to client FPS impact. Players can still fill drinks at ponds by right clicking a container. @ebayShopper
[FIXED] Wrong texture for z_hunter zombie. #1805 @schwanzkopfhegel @ebayShopper [FIXED] Wrong texture for z_hunter zombie. #1805 @schwanzkopfhegel @ebayShopper
[FIXED] Refuel with generator at gas station not working. #1806 @Helios27 @ebayShopper [FIXED] Refuel with generator at gas station not working. #1806 @Helios27 @ebayShopper
@@ -22,6 +23,7 @@
[FIXED] HALO fresh spawns stuck swimming in air on Napf and failing to start correctly sometimes. #1809 @oiad @ebayShopper [FIXED] HALO fresh spawns stuck swimming in air on Napf and failing to start correctly sometimes. #1809 @oiad @ebayShopper
[FIXED] Self actions sometimes duplicating when changing clothes and looking at a safe. @jOoPs @ebayShopper [FIXED] Self actions sometimes duplicating when changing clothes and looking at a safe. @jOoPs @ebayShopper
[FIXED] Wrong bleeding icon on vanilla status UI. @jOoPs @ebayShopper [FIXED] Wrong bleeding icon on vanilla status UI. @jOoPs @ebayShopper
[FIXED] It is no longer possible to autoRun under ponds on Chernarus. #1827 @schwanzkopfhegel
[NOTE] Updated server files were released with the four hotfixes below on December 11th, 2016 (http://dayzepoch.com/a2dayzepoch.php) [NOTE] Updated server files were released with the four hotfixes below on December 11th, 2016 (http://dayzepoch.com/a2dayzepoch.php)
[FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade [FIXED] Hive child 309 errors that resulted in broken saving of newly built storage object inventory. @icomrade

View File

@@ -0,0 +1,19 @@
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;";
};
};
};

View File

@@ -578,6 +578,7 @@ class CfgVehicles {
#include "Buildings\Land_telek1.hpp" #include "Buildings\Land_telek1.hpp"
#include "Buildings\Land_VASICore.hpp" #include "Buildings\Land_VASICore.hpp"
#include "Buildings\Land_Vysilac_FM.hpp" #include "Buildings\Land_Vysilac_FM.hpp"
#include "Buildings\Land_pumpa.hpp"
//Duplicates of Epoch items in DZE\Prop_Defs.hpp //Duplicates of Epoch items in DZE\Prop_Defs.hpp
//#include "CamoNetting.hpp" //#include "CamoNetting.hpp"

View File

@@ -10,11 +10,12 @@ _action = _this select 0;
_object = _this select 1; _object = _this select 1;
_show = switch _action do { _show = switch _action do {
case "StudyBody": {!IS_ALIVE};
case "Butcher": {!IS_ALIVE && !IN_VEHICLE && CAN_DO && !(_object getVariable["meatHarvested",false]) && !IS_PZOMBIE}; case "Butcher": {!IS_ALIVE && !IN_VEHICLE && CAN_DO && !(_object getVariable["meatHarvested",false]) && !IS_PZOMBIE};
case "Drink": {!IN_VEHICLE && CAN_DO && !dayz_isSwimming};
case "PushPlane": {IS_ALIVE && !IN_VEHICLE && CAN_DO && count crew _object == 0 && !isEngineOn _object && !IS_PZOMBIE}; case "PushPlane": {IS_ALIVE && !IN_VEHICLE && CAN_DO && count crew _object == 0 && !isEngineOn _object && !IS_PZOMBIE};
//case "Repair": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX}; //case "Repair": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX};
//case "Salvage": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX && (DZE_salvageLocked or !locked _object)}; //case "Salvage": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX && (DZE_salvageLocked or !locked _object)};
case "StudyBody": {!IS_ALIVE};
default {false}; default {false};
}; };

View File

@@ -0,0 +1,24 @@
private ["_bb","_dir","_nearWaterHole","_w2m"];
_nearWaterHole = false;
{
{
_w2m = _x worldToModel (getPosATL player);
_bb = (boundingbox _x) select 1;
_dir = [player, _x] call BIS_fnc_relativeDirTo;
if (_dir > 180) then {
_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;
};
} count (nearestObjects [_x, [], 1]);
if (_nearWaterHole) exitWith {};
} forEach (nearestObjects [player, ["waterHoleProxy"], 50]);
_nearWaterHole

View File

@@ -5,7 +5,7 @@ scriptName "Functions\misc\fn_selfActions.sqf";
- [] call fnc_usec_selfActions; - [] call fnc_usec_selfActions;
************************************************************/ ************************************************************/
if (dayz_actionInProgress) exitWith {}; if (dayz_actionInProgress) exitWith {};
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names", private ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names","_nearWaterHole",
"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild", "_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached", "_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget", "_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
@@ -97,30 +97,19 @@ if ((_primaryWeapon in Dayz_fishingItems) && {!dayz_fishingInprogress} && {_inVe
s_player_fishing_veh = -1; s_player_fishing_veh = -1;
}; };
_canDoThis=false; /*
if (_canDo && !_inVehicle && !dayz_isSwimming) then { //FPS killer. Moved to CfgVehicles for Land_pumpa
{ _nearWaterHole = call fn_nearWaterHole;
_waterHoles = if (typeOf _x == "waterHoleProxy") then {nearestObjects [_x, [], 1];} else {[_x];}; if (_canDo && !_inVehicle && !dayz_isSwimming && _nearWaterHole) then {
{ if (s_player_Drinkfromhands < 0) then {
_w2m = _x worldToModel (getPosATL player); s_player_Drinkfromhands = player addAction [localize "STR_ACTIONS_DRINK2", "\z\addons\dayz_code\actions\player_drinkWater.sqf",player, 0.5, false, true];
_bb = (boundingbox _x) select 1; };
_dir = [player, _x] call BIS_fnc_relativeDirTo; if (_dir > 180) then {_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
_canDoThis = true;
};
} count _waterHoles;
if (_canDoThis) exitWith {
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];
};
};
} foreach nearestObjects [player, ["waterHoleProxy", "Land_pumpa"], 50];
}; };
if (!_canDoThis && s_player_Drinkfromhands >= 0) then { if (!_nearWaterHole && s_player_Drinkfromhands >= 0) then {
player removeAction s_player_Drinkfromhands; player removeAction s_player_Drinkfromhands;
s_player_Drinkfromhands = -1; s_player_Drinkfromhands = -1;
}; };
*/
if (_inVehicle) then { if (_inVehicle) then {
DZE_myVehicle = _vehicle; DZE_myVehicle = _vehicle;

View File

@@ -23,7 +23,7 @@ player setVariable ["NORRN_unconscious", r_player_unconscious, true];
_sandLevel = ctrlPosition ((uiNamespace getVariable 'DAYZ_GUI_waiting') displayCtrl 1400); _sandLevel = ctrlPosition ((uiNamespace getVariable 'DAYZ_GUI_waiting') displayCtrl 1400);
//diag_log [(diag_tickTime - _start) < _timeout , !r_player_unconscious , alive player ]; //diag_log [(diag_tickTime - _start) < _timeout , !r_player_unconscious , alive player ];
autoRunActive = false; dayz_autoRun = false;
if (player == vehicle player) then { if (player == vehicle player) then {
player playAction "CanNotMove"; player playAction "CanNotMove";

View File

@@ -29,17 +29,20 @@ if (isNil "keyboard_keys") then {
if (_ctrlState && !_altState) then {DZE_Z_ctrl = true;}; if (_ctrlState && !_altState) then {DZE_Z_ctrl = true;};
}; };
_autoRun = { _autoRun = {
if (!autoRunActive) then { if (!dayz_autoRun) then {
autoRunActive = true; dayz_autoRun = true;
autoRunThread = [] spawn { dayz_autoRunThread = [] spawn {
while {autoRunActive} do { while {dayz_autoRun} do {
if ((player != vehicle player) or (surfaceIsWater (getPosASL player)) or r_fracture_legs) exitWith {call autoRunOff;}; // SurfaceIsWater does not work for ponds
if (player != vehicle player or (surfaceIsWater getPosASL player) or (call fn_nearWaterHole) or r_fracture_legs) exitWith {
call dayz_autoRunOff;
};
player playAction "FastF"; player playAction "FastF";
uiSleep 0.5; uiSleep 0.5;
}; };
}; };
} else { } else {
call autoRunOff; call dayz_autoRunOff;
}; };
_handled = true; _handled = true;
}; };
@@ -144,7 +147,7 @@ if (isNil "keyboard_keys") then {
r_interrupt = true; r_interrupt = true;
}; };
if (DZE_Surrender) then {call dze_surrender_off}; if (DZE_Surrender) then {call dze_surrender_off};
if (autoRunActive) then {call autoRunOff;}; if (dayz_autoRun) then {call dayz_autoRunOff;};
}; };
// TODO: left/right, when gear open: onKeyDown = "[_this,'onKeyDown',0,107,0,107] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; // TODO: left/right, when gear open: onKeyDown = "[_this,'onKeyDown',0,107,0,107] execVM '\z\addons\dayz_code\system\handleGear.sqf'";
_noise = { _noise = {

View File

@@ -75,7 +75,7 @@ player setVariable ["inCombat", false, true];
r_player_unconscious = false; r_player_unconscious = false;
r_player_cardiac = false; r_player_cardiac = false;
_model = typeOf player; _model = typeOf player;
autoRunActive = false; dayz_autoRun = false;
_array = _this; _array = _this;
if (count _array > 0) then { if (count _array > 0) then {

View File

@@ -17,6 +17,7 @@ if (!isDedicated) then {
call compile preprocessFileLineNumbers "\z\addons\dayz_code\loot\compile.sqf"; call compile preprocessFileLineNumbers "\z\addons\dayz_code\loot\compile.sqf";
fn_dropItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_dropItem.sqf"; //fnc to drop items. _item call fn_dropItem; fn_dropItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_dropItem.sqf"; //fnc to drop items. _item call fn_dropItem;
fn_nearWaterHole = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_nearWaterHole.sqf";
BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf"; BIS_Effects_Burn = compile preprocessFile "\ca\Data\ParticleEffects\SCRIPTS\destruction\burn.sqf";
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf"; //Run on a players computer, checks if the player is near a zombie
player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them player_zombieAttack = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieAttack.sqf"; //Run on a players computer, causes a nearby zombie to attack them
@@ -155,7 +156,7 @@ if (!isDedicated) then {
player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf"; player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
// EPOCH ADDITIONS // EPOCH ADDITIONS
autoRunOff = {autoRunActive = false; terminate autoRunThread; player playActionNow "Stop";}; dayz_autoRunOff = {dayz_autoRun = false; terminate dayz_autoRunThread; player playActionNow "Stop";};
dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf"; dog_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dog_findTargetAgent.sqf";
dze_filterCheats = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_filterCheats.sqf"; dze_filterCheats = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_filterCheats.sqf";
dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf"; dze_isnearest_player = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\dze_isNearestPlayer.sqf";

View File

@@ -693,7 +693,7 @@ if (!isDedicated) then {
if (isNil "DZE_requireplot") then {DZE_requireplot = 1;}; if (isNil "DZE_requireplot") then {DZE_requireplot = 1;};
if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;}; if (isNil "DZE_StaticConstructionCount") then {DZE_StaticConstructionCount = 0;};
if (toLower DZE_DeathMsgChat in ["global","side"]) then {enableRadio true;}; //Needed for scripted global chat to show, doesn't seem to have any adverse effects if (toLower DZE_DeathMsgChat in ["global","side"]) then {enableRadio true;}; //Needed for scripted global chat to show, doesn't seem to have any adverse effects
autoRunActive = false; dayz_autoRun = false;
DZE_AntiWallCounter = 0; DZE_AntiWallCounter = 0;
DZE_myHaloVehicle = objNull; DZE_myHaloVehicle = objNull;
dayz_myLiftVehicle = objNull; dayz_myLiftVehicle = objNull;

View File

@@ -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 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);" 5 switchCamera !"\"switchCamera\", \n\n\n\"fadeMusic\"," !="rswitchCamera = 'switchCamera'" !"rswitchCameracode" !"\"switchCamera\", \"taskHint\"," !="player switchCamera (Dayz_constructionContext select 2);"
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 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" !"hen {nearestObjects [_x, [], 1];} else {[_x];};\n{\n_w2m = _x worldToModel (getPosATL player);\n_bb = (boundingbox _x) select 1;\n_d" !"_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" 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"