Commit 5445eb0
committed
bugfix(file): Case-correct the leading component of a relative path
Backported from bobtista/topic/trunk, which hit and fixed this on Linux on
29/07/2026. This branch forked before that and never picked it up.
fixFilenameFromWindowsPath copied the first component of a relative path
through verbatim before starting its case-insensitive traversal, so a
mis-cased leading directory could never be repaired. SidesList spells the
skirmish scripts path "data\Scripts\SkirmishScripts.scb" with a lowercase d
while it is "Data" on disk, so on a case-sensitive filesystem the open failed.
The skirmish team records are cleared immediately before that parse, so they
stayed empty. Player::initFromDict renames a skirmish AI to
Skirmish<Faction><StartIndex>, deletes the teams owned by its original
player<N> name, then copies its replacement teams out of those records - so
the AI ended up with no teams at all. setDefaultTeam found nothing (its assert
is compiled out of a release build), the AI's default team stayed null, and
its starting Command Center and units were created onto no team of its own.
hasAnyObjects() was therefore false, the AI counted as defeated on the first
frame, and the human won instantly.
Windows, macOS (case-insensitive APFS) and WSL over /mnt/c all hid this. It
reproduces on wasm, where MEMFS is case-sensitive, in this port and in the
vibecode port alike - confirmed by making the lowercase path resolve at
runtime and watching the same binary play normally.
This reverts the path-literal spelling fix that preceded it, so the file
system layer stays the single fix and this branch matches trunk exactly.1 parent 665f0b7 commit 5445eb0
3 files changed
Lines changed: 12 additions & 23 deletions
File tree
- Core/GameEngineDevice/Source/StdDevice/Common
- GeneralsMD/Code/GameEngine/Source/GameLogic/Map
- Generals/Code/GameEngine/Source/GameLogic/Map
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 137 | | |
145 | 138 | | |
146 | 139 | | |
| |||
152 | 145 | | |
153 | 146 | | |
154 | 147 | | |
155 | | - | |
156 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
| 510 | + | |
517 | 511 | | |
518 | 512 | | |
519 | 513 | | |
| |||
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 529 | + | |
536 | 530 | | |
537 | 531 | | |
538 | 532 | | |
| |||
0 commit comments