Commit 6c2000c
authored
Fix save/load bug preventing player movement with sv_savefmt 1/2 (#378)
After commit dc010d6, loading non-legacy saves (sv_savefmt 1 or 2)
would result in players being unable to move. This seems to have been
caused by localstack pointer corruption during the save/load process.
The issue seems to have occurred because:
1. Commit dc010d6 changed localstack from a static array to dynamically
allocated memory in the addressable memory region
2. When loading saves, SV_SpawnServer -> Q_InitProgs -> PR_Configure ->
PRAddressableFlush would reinitialize all addressable memory
3. The localstack pointer wasn't properly cleared, causing corruption of
the stringtable and breaking OP_PUSH pointers stored in saved games
The fix ensures that when addressable memory is flushed, the localstack
state is properly cleared. The localstack will be correctly reallocated
when progs are reloaded.1 parent f129cce commit 6c2000c
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
502 | 506 | | |
503 | 507 | | |
504 | 508 | | |
| |||
0 commit comments