From 32a0baf69700dbe3301dcee07fd366fe5a57134a Mon Sep 17 00:00:00 2001 From: Jacob Schmidt Date: Sat, 23 May 2026 08:54:31 -0500 Subject: [PATCH] Prioritize explicit garage spawn lanes - Reduce lane discovery radius to 25 - Separate explicit marker matches from fallback lanes so named lanes win --- .../functions/fnc_initContextService.sqf | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/arma/client/addons/garage/functions/fnc_initContextService.sqf b/arma/client/addons/garage/functions/fnc_initContextService.sqf index 345d979..89e41f9 100644 --- a/arma/client/addons/garage/functions/fnc_initContextService.sqf +++ b/arma/client/addons/garage/functions/fnc_initContextService.sqf @@ -62,7 +62,7 @@ GVAR(GarageContextServiceBaseClass) = compileFinal createHashMapFromArray [ ["spawnLanes", createHashMap], ["spawnRadius", 6], ["nearbyRadius", 30], - ["laneRadius", 150] + ["laneRadius", 25] ] }], ["findNearbyGarageObject", compileFinal { @@ -106,27 +106,25 @@ GVAR(GarageContextServiceBaseClass) = compileFinal createHashMapFromArray [ private _markerDistance = if (isNull _garageObject) then { player distance2D _spawnPosition } else { _garageObject distance2D _spawnPosition }; private _garageVarName = if (isNull _garageObject) then { "" } else { toLowerANSI (vehicleVarName _garageObject) }; private _markerKey = toLowerANSI _markerName; - private _nameScore = 0; - - if (_garageVarName isNotEqualTo "" && { (_markerKey find _garageVarName) >= 0 }) then { - _nameScore = -50; - }; + private _isExplicitMatch = _garageVarName isNotEqualTo "" && { (_markerKey find _garageVarName) >= 0 }; createHashMapFromArray [ ["name", _markerName], + ["isExplicitMatch", _isExplicitMatch], ["interactionPosition", _interactionPosition], ["sourceObject", _garageObject], ["spawnCategory", _spawnCategory], ["spawnHeading", markerDir _markerName], ["spawnPosition", _spawnPosition], - ["score", _markerDistance + _nameScore] + ["score", _markerDistance] ] }], ["discoverSpawnLanes", compileFinal { params [["_garageObject", objNull, [objNull]]]; - private _laneRadius = (_self call ["createDefaultContext", []]) getOrDefault ["laneRadius", 150]; - private _lanes = createHashMap; + private _laneRadius = (_self call ["createDefaultContext", []]) getOrDefault ["laneRadius", 25]; + private _explicitLanes = createHashMap; + private _fallbackLanes = createHashMap; { private _markerName = _x; @@ -142,13 +140,21 @@ GVAR(GarageContextServiceBaseClass) = compileFinal createHashMapFromArray [ if (_distance > _laneRadius) then { continue; }; private _spawnCategory = _entry getOrDefault ["spawnCategory", ""]; - private _currentEntry = _lanes getOrDefault [_spawnCategory, createHashMap]; + private _laneSet = _fallbackLanes; + if (_entry getOrDefault ["isExplicitMatch", false]) then { + _laneSet = _explicitLanes; + }; + private _currentEntry = _laneSet getOrDefault [_spawnCategory, createHashMap]; if (_currentEntry isEqualTo createHashMap || { (_entry getOrDefault ["score", 1e10]) < (_currentEntry getOrDefault ["score", 1e10]) }) then { - _lanes set [_spawnCategory, _entry]; + _laneSet set [_spawnCategory, _entry]; }; } forEach allMapMarkers; + private _lanes = createHashMap; + { _lanes set [_x, _y]; } forEach _fallbackLanes; + { _lanes set [_x, _y]; } forEach _explicitLanes; + _lanes }], ["selectSpawnLane", compileFinal {