diff --git a/addons/lifecycle/functions/fnc_findSpawnPosition.sqf b/addons/lifecycle/functions/fnc_findSpawnPosition.sqf index c854cf0..1b859e9 100644 --- a/addons/lifecycle/functions/fnc_findSpawnPosition.sqf +++ b/addons/lifecycle/functions/fnc_findSpawnPosition.sqf @@ -1,5 +1,7 @@ #include "..\script_component.hpp" +ISNILS(GVAR(minRoadSpawnManSpawnDistance), 20); + /** returns false or HashMap of { @@ -55,7 +57,7 @@ private _result = { case "road": { // for each position, get a road position close by private _road = selectRandom (_refPos nearRoads _halfSectorWidth); - if (count (_road nearEntities ["Man", 100]) == 0) then { + if (count (_road nearEntities ["Man", GVAR(minRoadSpawnManSpawnDistance)]) == 0) then { _road } else { objNull diff --git a/addons/voyage/functions/fnc_addCarCrew.sqf b/addons/voyage/functions/fnc_addCarCrew.sqf index d559531..28146c3 100644 --- a/addons/voyage/functions/fnc_addCarCrew.sqf +++ b/addons/voyage/functions/fnc_addCarCrew.sqf @@ -40,8 +40,10 @@ if (_spawnPositionRoad isEqualTo false) exitWith { private _segment = _spawnPositionRoad get "road"; (getRoadInfo _segment) params ["", "_width", "", "", "", "", "_begPos", "_endPos"]; +// spawn on road side, but *not* on the curb, as we'd have to check for buildings/other obstacles. +private _vehicleWidth= 2; // TODO: get real vehicle width private _dir = _begPos getDir _endPos; -private _lateralOffset = 0 max (_width - 2); // TODO: refactor to use real vehicle's boundingBox to put veh not too far out on the curb +private _lateralOffset = 0 max (_width/2 - _vehicleWidth); private _roadSidePos = (getPos _segment) vectorAdd ((vectorNormalized ((getPos _segment) vectorCrossProduct [0, 0, -1])) vectorMultiply _lateralOffset); [