aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2014-04-30 22:41:57 +0300
committerFilippos Karapetis2014-04-30 22:41:57 +0300
commit9d2bcbd499783d83fb85f1235774514e5db8c45b (patch)
treec062aa6f88251d15d720f96184eba3f8aa33d24e
parent16d46fda7cb0fcdc1e3243f58dbe99c02511676a (diff)
downloadscummvm-rg350-9d2bcbd499783d83fb85f1235774514e5db8c45b.tar.gz
scummvm-rg350-9d2bcbd499783d83fb85f1235774514e5db8c45b.tar.bz2
scummvm-rg350-9d2bcbd499783d83fb85f1235774514e5db8c45b.zip
MADS: Fix a crash when trying to pick up objects that can't be picked
-rw-r--r--engines/mads/nebular/game_nebular.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 34eb6f140c..b36de8f378 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -619,7 +619,7 @@ void GameNebular::unhandledAction() {
_vm->_dialogs->show(0x15);
} else if (action.isAction(VERB_TAKE)) {
int objId = _vm->_game->_objects.getIdFromDesc(action._activeAction._objectNameId);
- if (_vm->_game->_objects.isInInventory(objId))
+ if (objId >= 0 && _vm->_game->_objects.isInInventory(objId))
_vm->_dialogs->show(0x10);
else if (randVal <= 333)
_vm->_dialogs->show(0x8);