Fix to ensure any active conversation data or selected hotspot is cleared when restoring or restarting a game

svn-id: r30066
This commit is contained in:
Paul Gilbert 2007-12-29 04:25:26 +00:00
parent 52dc147f8c
commit a54f9c311a
3 changed files with 21 additions and 1 deletions

View File

@ -97,6 +97,9 @@ void Resources::reset() {
freeData();
_fieldList.reset();
_talkState = TALK_NONE;
_activeTalkData = NULL;
reloadData();
}
@ -712,6 +715,9 @@ void Resources::loadFromStream(Common::ReadStream *stream) {
_talkingCharacter = 0;
}
_talkState = TALK_NONE;
_activeTalkData = NULL;
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading hotspot data");
_hotspotData.loadFromStream(stream);
debugC(ERROR_DETAILED, kLureDebugScripts, "Loading active hotspots");

View File

@ -756,6 +756,11 @@ void Room::loadFromStream(Common::ReadStream *stream) {
if (saveVersion >= 26)
_talkDialog = TalkDialog::loadFromStream(stream);
// Clear any active hotspot
_hotspotId = 0;
_hotspotName[0] = '\0';
_statusLine[0] = '\0';
uint16 roomNum = stream->readUint16LE();
_roomNumber = 999; // Dummy room number so current room is faded out
setRoomNumber(roomNum, false);
@ -765,4 +770,13 @@ void Room::loadFromStream(Common::ReadStream *stream) {
_cursorState = (CursorState) stream->readUint16LE();
}
void Room::reset() {
_roomNumber = 999;
setTalkDialog(0, 0, 0, 0);
_hotspotId = 0;
_hotspotName[0] = '\0';
_statusLine[0] = '\0';
}
} // end of namespace Lure

View File

@ -127,7 +127,7 @@ public:
char *statusLine() { return _statusLine; }
void saveToStream(Common::WriteStream *stream);
void loadFromStream(Common::ReadStream *stream);
void reset() { _roomNumber = 999; }
void reset();
};
} // end of namespace Lure