Skip to content

Commit

Permalink
TOON: Fix bad character visibility after restore
Browse files Browse the repository at this point in the history
Bug #3307195: "TOON: Two instances of Flux Wildly"
  • Loading branch information
sylvaintv committed Jul 8, 2011
1 parent c5a945b commit 5398500
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion engines/toon/character.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5398500

Please sign in to comment.