aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-10-29 18:43:16 +0000
committerMax Horn2006-10-29 18:43:16 +0000
commit32f891f724834364666c1dc91f12cebbf608071b (patch)
treee64ae368b70772f1bf0c59cb9c8798ee8e7a6240
parent083a7c2549627451fd7ca4965eecdc2d09666f6e (diff)
downloadscummvm-rg350-32f891f724834364666c1dc91f12cebbf608071b.tar.gz
scummvm-rg350-32f891f724834364666c1dc91f12cebbf608071b.tar.bz2
scummvm-rg350-32f891f724834364666c1dc91f12cebbf608071b.zip
SCUMM: Avoid crash in debugger when omitting the state value in 'object state VALUE'
svn-id: r24572
-rw-r--r--engines/scumm/debugger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index 8b02db236a..04b4e5ab80 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -491,14 +491,14 @@ bool ScummDebugger::Cmd_Object(int argc, const char **argv) {
_vm->markObjectRectAsDirty(obj);
_vm->clearDrawObjectQueue();
_vm->runInventoryScript(obj);
- } else if (!strcmp(argv[2], "state")) {
+ } else if (!strcmp(argv[2], "state") && argc == 4) {
_vm->putState(obj, atoi(argv[3]));
//is BgNeedsRedraw enough?
_vm->_bgNeedsRedraw = true;
} else if (!strcmp(argv[2], "name")) {
DebugPrintf("Name of object %d: %s\n", obj, _vm->getObjOrActorName(obj));
} else {
- DebugPrintf("Unknown object command '%s'\nUse <pickup | state> as command\n", argv[2]);
+ DebugPrintf("Unknown object command '%s'\nUse <pickup | state | name> as command\n", argv[2]);
}
return true;