diff options
author | Filippos Karapetis | 2014-05-04 03:48:36 +0300 |
---|---|---|
committer | Filippos Karapetis | 2014-05-04 03:48:36 +0300 |
commit | f9b52398bdd621d4466a845c6d49f9f27e7a4482 (patch) | |
tree | 711447a0acf6d5b7960b9f4eeff1fbdb8aeb1203 /engines | |
parent | d38e1aa5006266dedf5e7de6382df8c321009ee7 (diff) | |
download | scummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.tar.gz scummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.tar.bz2 scummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.zip |
MADS: Add a sanity check in DynamicHotspots::remove()
Fixes a crash when loading outside the hut
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mads/hotspots.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp index 560726bda6..0853f66eac 100644 --- a/engines/mads/hotspots.cpp +++ b/engines/mads/hotspots.cpp @@ -97,7 +97,7 @@ int DynamicHotspots::setCursor(int index, CursorType cursor) { void DynamicHotspots::remove(int index) { Scene &scene = _vm->_game->_scene; - if (_entries[index]._active) { + if (index >= 0 && _entries[index]._active) { if (_entries[index]._seqIndex >= 0) scene._sequences[_entries[index]._seqIndex]._dynamicHotspotIndex = -1; _entries[index]._active = false; |