[Scummvm-cvs-logs] CVS: scummvm/sword1 objectman.cpp,1.6,1.7 objectman.h,1.5,1.6
Robert Göffringmann
lavosspawn at users.sourceforge.net
Wed Oct 20 22:00:38 CEST 2004
Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4539/sword1
Modified Files:
objectman.cpp objectman.h
Log Message:
this should work around bug #922774.
well, at least it should keep the engine from crashing.
Index: objectman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/objectman.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- objectman.cpp 11 Jan 2004 15:47:41 -0000 1.6
+++ objectman.cpp 21 Oct 2004 03:47:14 -0000 1.7
@@ -103,8 +103,10 @@
textId = 0; // get first line instead
}
uint32 offset = READ_LE_UINT32(addr + ((textId & ITM_ID) + 1)* 4);
- if (offset == 0)
+ if (offset == 0) {
warning("ObjectMan::lockText(%d): text number has no text lines", textId);
+ return _errorStr;
+ }
return addr + offset;
}
@@ -155,4 +157,6 @@
memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16));
}
+char *ObjectMan::_errorStr = "Error: Text not found.";
+
} // End of namespace Sword1
Index: objectman.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/objectman.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- objectman.h 11 Jan 2004 15:47:41 -0000 1.5
+++ objectman.h 21 Oct 2004 03:47:15 -0000 1.6
@@ -57,6 +57,7 @@
static const uint32 _textList[TOTAL_SECTIONS][7]; //a table of pointers to text files
uint16 _liveList[TOTAL_SECTIONS]; //which sections are active
uint8 *_cptData[TOTAL_SECTIONS];
+ static char *_errorStr;
};
} // End of namespace Sword1
More information about the Scummvm-git-logs
mailing list