fix demo crash after introduction

svn-id: r11131
This commit is contained in:
Gregory Montoir 2003-11-04 19:51:31 +00:00
parent 5caf79c8e5
commit 6a6644bac8
2 changed files with 9 additions and 2 deletions

View File

@ -1062,6 +1062,11 @@ uint16 Logic::roomRefreshObject(uint16 obj) {
uint16 curImage = _numFrames; uint16 curImage = _numFrames;
if (obj == 0 || obj > _numObjects) {
warning("Invalid object number %d", obj);
return curImage;
}
ObjectData *pod = &_objectData[obj]; ObjectData *pod = &_objectData[obj];
if (pod->image == 0) { if (pod->image == 0) {
return curImage; return curImage;
@ -1070,7 +1075,7 @@ uint16 Logic::roomRefreshObject(uint16 obj) {
// check the object is in the current room // check the object is in the current room
if (pod->room != _currentRoom) { 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)", 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; return curImage;
} }

View File

@ -105,6 +105,8 @@ QueenEngine::QueenEngine(GameDetector *detector, OSystem *syst)
} }
QueenEngine::~QueenEngine() { QueenEngine::~QueenEngine() {
_timer->removeTimerProc(&timerHandler);
delete _resource; delete _resource;
delete _display; delete _display;
delete _logic; delete _logic;
@ -158,7 +160,7 @@ void QueenEngine::roomChanged() {
_logic->playCutaway("cred.cut"); _logic->playCutaway("cred.cut");
} }
_logic->currentRoom(ROOM_HOTEL_LOBBY); //ROOM_HOTEL_UPSTAIRS); _logic->currentRoom(ROOM_HOTEL_LOBBY);
_logic->entryObj(584); _logic->entryObj(584);
_logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_JOE, 100, 2, true); _logic->roomDisplay(_logic->roomName(_logic->currentRoom()), RDM_FADE_JOE, 100, 2, true);