diff options
author | Robert Göffringmann | 2004-10-21 03:47:15 +0000 |
---|---|---|
committer | Robert Göffringmann | 2004-10-21 03:47:15 +0000 |
commit | e721c6de0c0f5f66beb9e602746d25713e0398f8 (patch) | |
tree | 2d424a56ce10f8297fe556e725df64dd2cb35a57 /sword1/objectman.cpp | |
parent | e58a097acfd231f36eda89f76b385c7c13d58ded (diff) | |
download | scummvm-rg350-e721c6de0c0f5f66beb9e602746d25713e0398f8.tar.gz scummvm-rg350-e721c6de0c0f5f66beb9e602746d25713e0398f8.tar.bz2 scummvm-rg350-e721c6de0c0f5f66beb9e602746d25713e0398f8.zip |
this should work around bug #922774.
well, at least it should keep the engine from crashing.
svn-id: r15622
Diffstat (limited to 'sword1/objectman.cpp')
-rw-r--r-- | sword1/objectman.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sword1/objectman.cpp b/sword1/objectman.cpp index aa46b2d132..f9c392fe01 100644 --- a/sword1/objectman.cpp +++ b/sword1/objectman.cpp @@ -103,8 +103,10 @@ char *ObjectMan::lockText(uint32 textId) { 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 @@ void ObjectMan::saveLiveList(uint16 *dest) { memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16)); } +char *ObjectMan::_errorStr = "Error: Text not found."; + } // End of namespace Sword1 |