diff options
author | sylvaintv | 2011-07-09 01:50:38 +0200 |
---|---|---|
committer | sylvaintv | 2011-07-09 01:50:38 +0200 |
commit | 53985000db22e2897626e2bf26d93d7241726323 (patch) | |
tree | 78d32a2c1e6cfaadab5da5fd0221cff3137eb732 /engines | |
parent | c5a945b56650bd826e51fd7cb907ba0c9d91e8f3 (diff) | |
download | scummvm-rg350-53985000db22e2897626e2bf26d93d7241726323.tar.gz scummvm-rg350-53985000db22e2897626e2bf26d93d7241726323.tar.bz2 scummvm-rg350-53985000db22e2897626e2bf26d93d7241726323.zip |
TOON: Fix bad character visibility after restore
Bug #3307195: "TOON: Two instances of Flux Wildly"
Diffstat (limited to 'engines')
-rw-r--r-- | engines/toon/character.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/toon/character.cpp b/engines/toon/character.cpp index 06c6e21d21..022214157a 100644 --- a/engines/toon/character.cpp +++ b/engines/toon/character.cpp @@ -596,7 +596,8 @@ int32 Character::getId() { void Character::save(Common::WriteStream *stream) { debugC(1, kDebugCharacter, "save(stream)"); - stream->writeSint32LE(_flags); + // we have to save visibility too, put in flags to not invalidate old savegames. + stream->writeSint32LE(_flags | ((_visible == false) ? 0x100 : 0)); stream->writeSint32LE(_x); stream->writeSint32LE(_y); stream->writeSint32LE(_z); @@ -633,6 +634,12 @@ void Character::load(Common::ReadStream *stream) { if (_sceneAnimationId > -1) { setAnimationInstance(_vm->getSceneAnimation(_sceneAnimationId)->_animInstance); } + + // "not visible" flag. + if (_flags & 0x100) { + _flags &= ~0x100; + setVisible(false); + } } void Character::setAnimScript(int32 animScriptId) { |