diff options
author | Filippos Karapetis | 2010-06-30 07:18:43 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-06-30 07:18:43 +0000 |
commit | 9f1413b338da98139efb68434f7f875e2abbd745 (patch) | |
tree | 8550a4e1671288c7cc59c7a27dc9d6b27c4786da /engines | |
parent | 7455c3ec3954e068090004369600c03b6ede43a2 (diff) | |
download | scummvm-rg350-9f1413b338da98139efb68434f7f875e2abbd745.tar.gz scummvm-rg350-9f1413b338da98139efb68434f7f875e2abbd745.tar.bz2 scummvm-rg350-9f1413b338da98139efb68434f7f875e2abbd745.zip |
When deleting a list node, erase its references to predecessor and successor nodes. Fixes cases where game scripts could reference a list node after it was deleted (e.g. QFG1 intro, Longbow when exiting the cave). Some slight cleanup
svn-id: r50515
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/klists.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/savegame.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp index eff0e725b8..ef2f40e235 100644 --- a/engines/sci/engine/klists.cpp +++ b/engines/sci/engine/klists.cpp @@ -346,7 +346,9 @@ reg_t kDeleteKey(EngineState *s, int argc, reg_t *argv) { if (!n->succ.isNull()) s->_segMan->lookupNode(n->succ)->pred = n->pred; - //s->_segMan->free_Node(node_pos); // TODO + // Erase references to the predecessor and successor nodes + n->pred = NULL_REG; + n->succ = NULL_REG; return make_reg(0, 1); // Signal success } diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp index bf7b88b699..b2528fe210 100644 --- a/engines/sci/engine/savegame.cpp +++ b/engines/sci/engine/savegame.cpp @@ -74,9 +74,7 @@ SongIterator *build_iterator(ResourceManager *resMan, int song_nr, SongIteratorT #ifdef USE_OLD_MUSIC_FUNCTIONS static void sync_songlib(Common::Serializer &s, SongLibrary &obj); -#endif -#ifdef USE_OLD_MUSIC_FUNCTIONS static void syncSong(Common::Serializer &s, Song &obj) { s.syncAsSint32LE(obj._handle); s.syncAsSint32LE(obj._resourceNum); |