aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2003-11-04 19:51:31 +0000
committerGregory Montoir2003-11-04 19:51:31 +0000
commit6a6644bac8685cb448042bbc12c831bab61fa7de (patch)
tree9d98ce5e5bc0f7505b9202db217f96d10a5186b0
parent5caf79c8e5124da88ca99881279591fbedf8ab61 (diff)
downloadscummvm-rg350-6a6644bac8685cb448042bbc12c831bab61fa7de.tar.gz
scummvm-rg350-6a6644bac8685cb448042bbc12c831bab61fa7de.tar.bz2
scummvm-rg350-6a6644bac8685cb448042bbc12c831bab61fa7de.zip
fix demo crash after introduction
svn-id: r11131
-rw-r--r--queen/logic.cpp7
-rw-r--r--queen/queen.cpp4
2 files changed, 9 insertions, 2 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp
index bc92b7c0b3..a208f0411c 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 db4f5c0e7e..dad766607a 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);