better gear menu check

should be less annoying
This commit is contained in:
icomrade
2016-10-05 20:13:26 -04:00
parent 50584d3ff4
commit 5381748c63

View File

@@ -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;