diff options
author | Andrew Kurushin | 2005-03-29 21:18:39 +0000 |
---|---|---|
committer | Andrew Kurushin | 2005-03-29 21:18:39 +0000 |
commit | 0266fcbd4b8a99ca004eaf71f34bd14cfd14224b (patch) | |
tree | b67756db2632eaa7425af52d35378d0359336a3b /saga | |
parent | 6bc301810b59ac097afcaafffabfbad679b97f6f (diff) | |
download | scummvm-rg350-0266fcbd4b8a99ca004eaf71f34bd14cfd14224b.tar.gz scummvm-rg350-0266fcbd4b8a99ca004eaf71f34bd14cfd14224b.tar.bz2 scummvm-rg350-0266fcbd4b8a99ca004eaf71f34bd14cfd14224b.zip |
fixed small bug
svn-id: r17288
Diffstat (limited to 'saga')
-rw-r--r-- | saga/isomap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/saga/isomap.cpp b/saga/isomap.cpp index 5baedd3fbf..179947d2db 100644 --- a/saga/isomap.cpp +++ b/saga/isomap.cpp @@ -342,6 +342,7 @@ int16 IsoMap::findMulti(int16 tileIndex, int16 absU, int16 absV, int16 absH) { int16 mv; int16 state; uint16 i, offset; + int16 *tiles; ru = (tileIndex >> 13) & 0x03; rv = (tileIndex >> 11) & 0x03; @@ -358,11 +359,13 @@ int16 IsoMap::findMulti(int16 tileIndex, int16 absU, int16 absV, int16 absH) { state = multiTileEntryData->currentState; offset = (ru + state * multiTileEntryData->uSize) * multiTileEntryData->vSize + rv; + offset *= sizeof(*_multiTableData); offset += multiTileEntryData->offset; - if (offset >= _multiDataCount * sizeof(*_multiTableData)) { + if (offset + sizeof(*_multiTableData) - 1 >= _multiDataCount * sizeof(*_multiTableData)) { error("wrong multiTileEntryData->offset"); } - tileIndex = _multiTableData[offset]; + tiles = (int16*)((byte*)_multiTableData + offset); + tileIndex = *tiles; if (tileIndex >= 256) { warning("something terrible happened"); return 1; |