From fdc7604697fc82c93e3bd6ae54953b4d34afb24d Mon Sep 17 00:00:00 2001 From: He-Man Date: Wed, 7 Sep 2022 19:09:38 +0200 Subject: [PATCH] nearestObjects -> nearestTerrainObjects Arma 2.1 no longer support Trash Loot / Phonebooth (smaller terrain objects) within the nearestObjects command. So also added nearestTerrainObjects within the relevant lines --- Sources/epoch_code/compile/EPOCH_lootTrash.sqf | 2 +- .../gui/scripts/craftingv2/EPOCH_crafting_checkNearby.sqf | 4 ++-- .../epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf index 88bf0af4..04e97af0 100644 --- a/Sources/epoch_code/compile/EPOCH_lootTrash.sqf +++ b/Sources/epoch_code/compile/EPOCH_lootTrash.sqf @@ -31,7 +31,7 @@ if (diag_tickTime - EPOCH_lastTrash > 2) then { _lootAnimalObj = objNull; _bankTerminal = objNull; _trashType = 0; - _objects = nearestObjects[player, [], 2]; + _objects = nearestObjects[player, [], 2] + nearestTerrainObjects [player, [], 2]; { _found = false; _foundTerminal = false; diff --git a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_checkNearby.sqf b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_checkNearby.sqf index 6c56a530..659bbc03 100644 --- a/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_checkNearby.sqf +++ b/Sources/epoch_code/gui/scripts/craftingv2/EPOCH_crafting_checkNearby.sqf @@ -22,7 +22,7 @@ switch (_type) do { case 0: { private ["_test1","_test2","_find"]; - _nearObjects = nearestObjects [player, [], _dist]; + _nearObjects = nearestObjects [player, [], _dist] + nearestTerrainObjects [player, [], _dist]; _test1 = 0; { _test2 = _x; @@ -39,7 +39,7 @@ switch (_type) do { }; case 2: { - _nearObjects = nearestObjects [player, [], _dist]; + _nearObjects = nearestObjects [player, [], _dist] + nearestTerrainObjects [player, [], _dist]; _check = _check select 0; _tmpResult = false; { diff --git a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp index c990a588..2755708f 100644 --- a/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp +++ b/Sources/epoch_config/Configs/CfgActionMenu/CfgActionMenu_core.hpp @@ -50,7 +50,7 @@ class CfgActionMenu dyna_mapDeathMarker = "(((getArray(('CfgMarkerSets' call EPOCH_returnConfig) >> 'DeathMarker' >> 'markerArray') select 0) select 0) in allMapMarkers)"; 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_Watersource = "call {_nearObjects = nearestObjects [player, [], 2] + nearestTerrainObjects [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! };