Commit 785cdf6
committed
[JK2] Fix crash/hang when loading saved games on 64-bit builds
Add missing watchTarget pointer field to savefields_gNPC table.
The watchTarget field (gentity_t*) in gNPC_t was being serialized as
int32_t in sg_export() but was not included in the savefields_gNPC
conversion table. This caused:
- On save: 64-bit pointer truncated to 32-bit
- On load: Truncated value used as invalid pointer
- On use: Crash (Windows x64) or infinite loop (macOS ARM64) when
NPC_BSCinematic() calls CalcEntitySpot(NPCInfo->watchTarget, ...)
The Jedi Academy codebase (code/game/g_savegame.cpp) correctly includes
watchTarget in its savefields_gNPC table, but the JK2 codebase was
missing this entry.
Fixes #12781 parent e76263d commit 785cdf6
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
236 | | - | |
| 237 | + | |
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| |||
0 commit comments