diff --git a/queen/logic.cpp b/queen/logic.cpp index bc92b7c0b3d..a208f0411c2 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -1062,6 +1062,11 @@ uint16 Logic::roomRefreshObject(uint16 obj) { uint16 curImage = _numFrames; + if (obj == 0 || obj > _numObjects) { + warning("Invalid object number %d", obj); + return curImage; + } + ObjectData *pod = &_objectData[obj]; if (pod->image == 0) { return curImage; @@ -1070,7 +1075,7 @@ uint16 Logic::roomRefreshObject(uint16 obj) { // check the object is in the current room if (pod->room != _currentRoom) { warning("Logic::roomRefreshObject() - Trying to display an object (%i=%s) that is not in room (object room=%i, current room=%i)", - obj, _objName[_objectData[obj].name], pod->room, _currentRoom); + obj, _objName[ABS(pod->name)], pod->room, _currentRoom); return curImage; } diff --git a/queen/queen.cpp b/queen/queen.cpp index db4f5c0e7ec..dad766607a0 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -105,6 +105,8 @@ QueenEngine::QueenEngine(GameDetector *detector, OSystem *syst) } QueenEngine::~QueenEngine() { + + _timer->removeTimerProc(&timerHandler); delete _resource; delete _display; delete _logic; @@ -158,7 +160,7 @@ void QueenEngine::roomChanged() { _logic->playCutaway("cred.cut"); } - _logic->currentRoom(ROOM_HOTEL_LOBBY); //ROOM_HOTEL_UPSTAIRS); + _logic->currentRoom(ROOM_HOTEL_LOBBY); _logic->entryObj(584); _logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_JOE, 100, 2, true);