diff --git a/Sources/epoch_code/compile/servicepoint/EPOCH_SP_Check.sqf b/Sources/epoch_code/compile/servicepoint/EPOCH_SP_Check.sqf index e34f8886..845e5908 100644 --- a/Sources/epoch_code/compile/servicepoint/EPOCH_SP_Check.sqf +++ b/Sources/epoch_code/compile/servicepoint/EPOCH_SP_Check.sqf @@ -32,9 +32,23 @@ _ServicePointClasses = ["CfgServicePoint", "ServicePointClasses", []] call EPO if (_servicepoints isequalto [] && _ServicePointClasses isequalto []) exitwith {false}; _inSP = false; -if (({player distance _x < _servicepointDist} count _servicepoints > 0)) then { - _inSP = true; -}; +{ + if (count _x > 3) then { + _x params ["_pos","_dist","_vehtypes"]; + { + if (_vehicle iskindof _x && _vehicle distance _pos < _dist) exitwith { + _inSP = true; + }; + } foreach _vehtypes; + } + else { + if (_vehicle distance _x < _servicepointDist) then { + _inSP = true; + }; + }; + if (_inSP) exitwith {}; +} foreach _servicepoints; + if (!_inSP) then { if !(_ServicePointClasses isequalto []) then { _nearClasses = nearestobjects [_vehicle,_ServicePointClasses,_servicepointDist]; @@ -43,4 +57,19 @@ if (!_inSP) then { }; }; }; +if (!_inSP) then { + _servicepointsAir = getArray (_config >> worldname >> 'ServicePointsAir'); + if (_vehicle iskindof "AIR" || _vehicle iskindof "SHIP") then { + if (({player distance _x < _servicepointDist} count _servicepointsAir > 0)) then { + _inSP = true; + }; + }; + if (_inSP) exitwith {}; + _servicepointsLand = getArray (_config >> worldname >> 'ServicePointsLand'); + if (_vehicle iskindof "Landvehicle" || _vehicle iskindof "SHIP") then { + if (({player distance _x < _servicepointDist} count _servicepointsLand > 0)) then { + _inSP = true; + }; + }; +}; _inSP