From 32f891f724834364666c1dc91f12cebbf608071b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 29 Oct 2006 18:43:16 +0000 Subject: [PATCH] SCUMM: Avoid crash in debugger when omitting the state value in 'object state VALUE' svn-id: r24572 --- engines/scumm/debugger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index 8b02db236ab..04b4e5ab802 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 as command\n", argv[2]); + DebugPrintf("Unknown object command '%s'\nUse as command\n", argv[2]); } return true;