diff options
author | Paul Gilbert | 2006-05-23 12:36:57 +0000 |
---|---|---|
committer | Paul Gilbert | 2006-05-23 12:36:57 +0000 |
commit | 3e4566e196c07572379b814f1a145d13c68bfed1 (patch) | |
tree | e7ebe0c8a8110aafc578a26e81b9c954bc63207e /engines/lure | |
parent | 5f64d7009ed3722da9e76d4e920fb061aec57c43 (diff) | |
download | scummvm-rg350-3e4566e196c07572379b814f1a145d13c68bfed1.tar.gz scummvm-rg350-3e4566e196c07572379b814f1a145d13c68bfed1.tar.bz2 scummvm-rg350-3e4566e196c07572379b814f1a145d13c68bfed1.zip |
Added some extra safety checks. Also contains some started work on redesigning the display of the current action
svn-id: r22577
Diffstat (limited to 'engines/lure')
-rw-r--r-- | engines/lure/room.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index 4452acad71..a543db4207 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -83,6 +83,8 @@ Room::Room(): _screen(Screen::getReference()) { _showInfo = false; _isExit = false; _destRoomNumber = 0; + _cursorState = CS_NONE; + //****DEBUG**** memset(tempLayer, 0, DECODED_PATHS_WIDTH * DECODED_PATHS_HEIGHT * 2); } @@ -356,6 +358,7 @@ void Room::update() { // Handle first layer (layer 3) for (i = hotspots.begin(); i != hotspots.end(); ++i) { Hotspot &h = *i.operator*(); + if ((h.roomNumber() == _roomNumber) && h.isActiveAnimation() && (h.layer() == 3)) { flagCoveredCells(h); addAnimation(h); @@ -382,6 +385,7 @@ void Room::update() { } for (iTemp = tempList.begin(); iTemp != tempList.end(); ++iTemp) { Hotspot &h = *iTemp.operator*(); + flagCoveredCells(h); addAnimation(h); addLayers(h); @@ -390,6 +394,7 @@ void Room::update() { // Handle third layer (layer 2) for (i = hotspots.begin(); i != hotspots.end(); ++i) { Hotspot &h = *i.operator*(); + if ((h.roomNumber() == _roomNumber) && h.isActiveAnimation() && (h.layer() == 2)) { flagCoveredCells(h); addAnimation(h); @@ -424,14 +429,20 @@ void Room::update() { s.writeString(0, 0, _hotspotName, false, DIALOG_TEXT_COLOUR); } else { char buffer[MAX_DESC_SIZE]; - strcpy(buffer, res.getCurrentActionStr()); + const char *actionStr = res.getCurrentActionStr(); + strcpy(buffer, actionStr); if (action != STATUS) { strcat(buffer, " "); - if (usedId != 0xffff) { - uint16 nameId = res.getHotspot(usedId)->nameId; - strings.getString(nameId, buffer + strlen(buffer), NULL, NULL); + if ((usedId != 0xffff) && (usedId != 0)) { + HotspotData *usedHotspot = res.getHotspot(usedId); + + if (usedHotspot != NULL) + strings.getString(usedHotspot->nameId, buffer + strlen(buffer), NULL, NULL); + else + strcat(buffer, "???"); + if (action == GIVE) strcat(buffer, " to "); else strcat(buffer, " on "); } |