From 5381748c63e5f48e918472fae9da86de5a2f7349 Mon Sep 17 00:00:00 2001 From: icomrade Date: Wed, 5 Oct 2016 20:13:26 -0400 Subject: [PATCH] better gear menu check should be less annoying --- SQF/dayz_code/compile/fn_gearMenuChecks.sqf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/SQF/dayz_code/compile/fn_gearMenuChecks.sqf b/SQF/dayz_code/compile/fn_gearMenuChecks.sqf index ad6725121..64a0ae544 100644 --- a/SQF/dayz_code/compile/fn_gearMenuChecks.sqf +++ b/SQF/dayz_code/compile/fn_gearMenuChecks.sqf @@ -11,12 +11,17 @@ if ((vehicle player) == player) then { if (locked _cTarget && {(_cTarget isKindOf "LandVehicle") or {_cTarget isKindOf "Air"} or {_cTarget isKindOf "Ship"}} && {(player distance _cTarget) <= _dis}) then { _exit = true; } else { - _nearestObjects = (position player) nearEntities [["Air", "Car", "Motorcycle", "Tank"], 26]; + _nearestObjects = (position player) nearEntities [["Air", "Car", "Motorcycle", "Tank", "Ship"], 26]; if (count _nearestObjects >= 1) then { { - _isAir = false; - if (_x isKindOf "Air") then {_isAir = true; if (_x isKindOf "USEC_ch53_E" || _x isKindOf "MV22") then {_dis = 25;} else {_dis = 12;};} else {_dis = 8;}; - if (locked _x && {(_x isKindOf "LandVehicle") or {_isAir} or {_x isKindOf "Ship"}} && {(player distance _x) <= _dis}) then { + _vehType = TypeOf _x; + _dis = getNumber (configFile >> "CfgVehicles" >> _vehType >> "supplyRadius"); + if (_dis < 2) then {_dis = _dis * 4;} else {_dis = _dis * 3;}; //There seems to be significant inaccuracy of the supplyRadius config definition that is worse when the value is smaller + _dis = _dis min 12; + _gearSelection = getText (configFile >> "CfgVehicles" >> _vehType >> "memoryPointSupply"); + _supplyPositionWorld = _x modelToWorld (_x selectionPosition _gearSelection); + if (_x isKindOf "USEC_ch53_E" || _x isKindOf "MV22") then {_dis = 25;}; + if (locked _x && {(_supplyPositionWorld distance player) <= _dis}) then { _exit = true; }; } forEach _nearestObjects;