aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/startrek/room.cpp5
-rw-r--r--engines/startrek/room.h3
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/startrek/room.cpp b/engines/startrek/room.cpp
index a34af48b0b..9fc0431e81 100644
--- a/engines/startrek/room.cpp
+++ b/engines/startrek/room.cpp
@@ -49,6 +49,7 @@ Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMissi
int size = rdfFile->size();
_rdfData = new byte[size];
+ _rdfSize = size;
rdfFile->read(_rdfData, size);
delete rdfFile;
@@ -279,7 +280,9 @@ Common::String Room::patchRoomMessage(const char *text) {
void Room::loadOtherRoomMessages() {
uint16 startOffset = readRdfWord(14);
- uint16 endOffset = readRdfWord(16);
+ // Some RDF files, lile MUDD0, contain text beyond the end offset,
+ // so we read up to the end of the file
+ uint16 endOffset = _rdfSize; // readRdfWord(16);
uint16 offset = startOffset;
const char *validPrefixes[] = {
"BRI", "COM", "DEM", "FEA", "GEN", "LOV", "MUD", "SIN", "TRI", "TUG", "VEN"
diff --git a/engines/startrek/room.h b/engines/startrek/room.h
index f507b9fd0d..6aeed92c41 100644
--- a/engines/startrek/room.h
+++ b/engines/startrek/room.h
@@ -149,10 +149,11 @@ public:
*/
Common::Point getSpawnPosition(int crewmanIndex);
-public:
byte *_rdfData;
private:
+ uint16 _rdfSize;
+
StarTrekEngine *_vm;
AwayMission *_awayMission;