diff options
author | Sven Hesse | 2006-05-31 10:55:57 +0000 |
---|---|---|
committer | Sven Hesse | 2006-05-31 10:55:57 +0000 |
commit | da69cc267cbae8dff5ff3bb4f88ca8c81c5bc220 (patch) | |
tree | f59e84e3767e00baffab15cf310fb8fbce2de33b /engines | |
parent | 31ebfdd1be2a099713962dea0c8b275aa59aa0a5 (diff) | |
download | scummvm-rg350-da69cc267cbae8dff5ff3bb4f88ca8c81c5bc220.tar.gz scummvm-rg350-da69cc267cbae8dff5ff3bb4f88ca8c81c5bc220.tar.bz2 scummvm-rg350-da69cc267cbae8dff5ff3bb4f88ca8c81c5bc220.zip |
Hopefully fixed bug #1498024
svn-id: r22796
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/goblin.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/engines/gob/goblin.cpp b/engines/gob/goblin.cpp index 9c7a337369..f3bf22ad61 100644 --- a/engines/gob/goblin.cpp +++ b/engines/gob/goblin.cpp @@ -933,12 +933,14 @@ void Goblin::targetItem(void) { } } - if ((_vm->_map->_itemsMap[_pressedMapY + - 1][_pressedMapX]) == - (_vm->_map->_itemsMap[_pressedMapY][_pressedMapX])) { - _pressedMapY++; - _vm->_map->_destY = _pressedMapY; - _gobDestY = _pressedMapY; + if (_pressedMapY < (_vm->_map->_mapHeight-1)) { + if ((_vm->_map->_itemsMap[_pressedMapY + + 1][_pressedMapX]) == + (_vm->_map->_itemsMap[_pressedMapY][_pressedMapX])) { + _pressedMapY++; + _vm->_map->_destY = _pressedMapY; + _gobDestY = _pressedMapY; + } } } @@ -1024,8 +1026,8 @@ void Goblin::moveFindItem(int16 posX, int16 posY) { break; } - _pressedMapX = posX / 12; - _pressedMapY = posY / 6; + _pressedMapX = MIN(posX / 12, 25); + _pressedMapY = MIN(posY / 6, 27); if (_vm->_map->_itemsMap[_pressedMapY][_pressedMapX] == 0 && i < 20) { |