Skip to content

bugfix(map): Resolve map names that carry either path separator - #3109

Draft
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/lan-map-resolution
Draft

bugfix(map): Resolve map names that carry either path separator#3109
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/lan-map-resolution

Conversation

@bobtista

@bobtista bobtista commented Aug 11, 2026

Copy link
Copy Markdown

MapCache::findMap lowercased the name and then did an exact match against the cache key, so a name
that carried the other path separator never resolved. The map cache keys are built with the platform
separator, while a name can reach the lookup from somewhere that stored the other one, such as a LAN
preference written by a build on a different platform. The lookup silently returns null and the
caller treats the map as absent.

LanGameOptionsMenuInit hit exactly that. It looked the host's preferred map up with a raw lowercased
TheMapCache->find, and on a miss the host slot is never marked as having the map and the map CRC and
size are never set.

Now findMap converts the name's separators to the platform one before matching, so either form
resolves to the same entry. The menu also resolves through findMap and sets the canonical
m_fileName on the game rather than the raw preference string, which keeps one lookup instead of two.

Reproduction:

  1. Have a preferred LAN map whose stored name uses / where the map cache key uses \, or the
    reverse. A preference carried over from a build on the other platform does this.
  2. Host a LAN game.
  3. Observe the host slot is not marked as having the map, and the map CRC and size are not set.

Measured by taking a real cache key, flipping every separator in it, and resolving both forms through
findMap against the same cache:

lookup before after
key as stored (...\maps\(3 letter names required)\...) resolves resolves
same key with separators flipped (.../maps/(3 letter names required)/...) does not resolve resolves

The native form is the control, so a pass is distinguishable from "the cache was empty".

Todo:

  • A name carrying the other separator resolves to the same cache entry
  • A name carrying the platform separator still resolves, as a control
  • Replicate to Generals

@bobtista
bobtista marked this pull request as draft August 11, 2026 15:51
@bobtista bobtista self-assigned this Aug 11, 2026
@bobtista bobtista added the Platform Work towards platform support, such as Linux, MacOS label Aug 11, 2026
@bobtista
bobtista force-pushed the bobtista/bugfix/lan-map-resolution branch from 7080bd0 to 27877e2 Compare August 27, 2026 16:30
@bobtista
bobtista force-pushed the bobtista/bugfix/lan-map-resolution branch from 27877e2 to 5a83502 Compare August 28, 2026 07:18
@bobtista bobtista changed the title bugfix(gui): Resolve the host's selected map through the map cache bugfix(map): Resolve map names that carry either path separator Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform Work towards platform support, such as Linux, MacOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host's preferred LAN map is not matched when its stored name uses a different separator

1 participant