From 2ddd524d9c9cba52dcaf30592805a0a56f2c20d5 Mon Sep 17 00:00:00 2001 From: Grahame Date: Sun, 19 May 2019 18:07:36 -0400 Subject: [PATCH 1/2] Add check for ambient water sources Adds the core check for an ambient water source, e.g. a pond or stream but not sea water --- .../epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp index 1655d4f1..c990a588 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp @@ -51,6 +51,7 @@ class CfgActionMenu dyna_AtHome = "call {_nearjammers = (nearestObjects[player, call EPOCH_JammerClasses, call EPOCH_MaxJammerRange]) select {player distance _x < (getnumber (getmissionconfig 'cfgEpochClient' >> 'CfgJammers' >> (typeof _x) >> 'buildingJammerRange'))};if (_nearjammers isEqualTo []) exitwith {false};_nearestJammer = _nearjammers select 0;((_nearestJammer getVariable['BUILD_OWNER', '-1']) in[getPlayerUID player, Epoch_my_GroupUID])}"; dyna_Watersource = "call {_nearObjects = nearestObjects [player, [], 2];_check = 'water';_ok = false;{if (alive _x) then {_ok = [_x, _check] call EPOCH_worldObjectType;};if (_ok) exitWith {};} forEach _nearObjects;_ok}"; + dyna_DirtyWatersource = "((surfaceiswater position player) && (position player isFlatEmpty [-1, -1, -1, -1, 0, true] isEqualTo []) && (getPosASL player select 2 > 2) && (getPosATL player select 2 < 0.1))"; dyna_Paintobj = "objnull"; // <--- internal use only! }; From 8c10b4790cf375a8bf11bd9a21b0ebb2dc4ee540 Mon Sep 17 00:00:00 2001 From: Grahame Date: Sun, 19 May 2019 18:08:47 -0400 Subject: [PATCH 2/2] Adds ambient water sources Adds the ability to drink from ambient water sources like ponds and streams but not sea water --- .../epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp index 264b706a..2afd7bc7 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_self.hpp @@ -115,7 +115,7 @@ class base_mode_attach }; class Drink { - condition = "dyna_Watersource"; + condition = "dyna_Watersource || dyna_DirtyWatersource"; action = "if (currentweapon player == '') then {player playmove 'AinvPknlMstpSnonWnonDnon_Putdown_AmovPknlMstpSnonWnonDnon';}else {if (currentweapon player == handgunweapon player) then {player playmove 'AinvPknlMstpSrasWpstDnon_Putdown_AmovPknlMstpSrasWpstDnon';}else { player playmove 'AinvPknlMstpSrasWrflDnon_Putdown_AmovPknlMstpSrasWrflDnon';};};{_output = _x call EPOCH_giveAttributes;if (_output != '') then {[_output, 5] call Epoch_message_stack;};} foreach [['Thirst',100],['Toxicity',1,1],['Stamina',10]];"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\Drink.paa"; tooltip = "Drink"; @@ -275,4 +275,4 @@ class Epad action = "if (isnull (finddisplay 9898)) then {createdialog 'epoch_tablet_gui';};"; icon = "x\addons\a3_epoch_code\Data\UI\buttons\Epad.paa"; tooltip = "E-Pad"; -}; \ No newline at end of file +};