diff options
author | Simon Howard | 2013-10-23 00:40:09 +0000 |
---|---|---|
committer | Simon Howard | 2013-10-23 00:40:09 +0000 |
commit | 436d8edbb83fd51dd75563d608b5d592f9eecece (patch) | |
tree | 155184b3681cf676a1e2c57859388b92b2c639ad /src/heretic | |
parent | ead4a7a8bd40d4a5ff65e078956678da0d227f12 (diff) | |
download | chocolate-doom-436d8edbb83fd51dd75563d608b5d592f9eecece.tar.gz chocolate-doom-436d8edbb83fd51dd75563d608b5d592f9eecece.tar.bz2 chocolate-doom-436d8edbb83fd51dd75563d608b5d592f9eecece.zip |
When loading Heretic savegames, NULL out certain special values which
hold pointers to other mobj_t objects that will no longer be valid.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2718
Diffstat (limited to 'src/heretic')
-rw-r--r-- | src/heretic/p_saveg.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/heretic/p_saveg.c b/src/heretic/p_saveg.c index 195f36a4..e0983f8c 100644 --- a/src/heretic/p_saveg.c +++ b/src/heretic/p_saveg.c @@ -879,6 +879,32 @@ static void saveg_read_mobj_t(mobj_t *str) // specialval_t special2; saveg_read_specialval_t(&str->special2); + // Now we have a bunch of hacks to try to NULL out special values + // where special[12] contained a mobj_t pointer that isn't valid + // any more. This isn't in Vanilla but at least it stops the game + // from crashing. + + switch (str->type) + { + // Gas pods use special2.m to point to the pod generator + // that made it. + case MT_POD: + str->special2.m = NULL; + break; + + // Several thing types use special1.m to mean 'target': + case MT_MACEFX4: // A_DeathBallImpact + case MT_WHIRLWIND: // A_WhirlwindSeek + case MT_MUMMYFX1: // A_MummyFX1Seek + case MT_HORNRODFX2: // A_SkullRodPL2Seek + case MT_PHOENIXFX1: // A_PhoenixPuff + str->special1.m = NULL; + break; + + default: + break; + } + // int health; str->health = SV_ReadLong(); |