From 71f2f4f6bdcd8261c0fd2cb65c93840ab2aa90a7 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Mon, 18 Jun 2007 09:07:03 +0000 Subject: Fix bug #1738870 - Elvira1: Glitch after opening a sarcophagus. svn-id: r27520 --- engines/agos/vga.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'engines/agos/vga.cpp') diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp index 8b9d685dec..a618ba8dd3 100644 --- a/engines/agos/vga.cpp +++ b/engines/agos/vga.cpp @@ -804,16 +804,19 @@ void AGOSEngine::checkWaitEndTable() { } void AGOSEngine::vc17_waitEnd() { + uint16 id = vcReadNextWord(); + VgaSleepStruct *vfs = _waitEndTable; while (vfs->ident) vfs++; - vfs->ident = vcReadNextWord(); - vfs->code_ptr = _vcPtr; - vfs->sprite_id = _vgaCurSpriteId; - vfs->cur_vga_file = _vgaCurZoneNum; - - _vcPtr = (byte *)&_vc_get_out_of_code; + if (isSpriteLoaded(id, id / 100)) { + vfs->ident = id; + vfs->code_ptr = _vcPtr; + vfs->sprite_id = _vgaCurSpriteId; + vfs->cur_vga_file = _vgaCurZoneNum; + _vcPtr = (byte *)&_vc_get_out_of_code; + } } void AGOSEngine::vc18_jump() { -- cgit v1.2.3