SCUMM: Avoid crash in debugger when omitting the state value in 'object state VALUE'

svn-id: r24572
This commit is contained in:
Max Horn 2006-10-29 18:43:16 +00:00
parent 083a7c2549
commit 32f891f724

View File

@ -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;