Changed Table to return 0 instead of -1 when lookup fails. Lookup already yields 1-based values when the item is found.
svn-id: r28600
This commit is contained in:
parent
9694215490
commit
a2a450dfae
7 changed files with 16 additions and 13 deletions
|
@ -116,7 +116,7 @@ bool Debugger::Cmd_Give(int argc, const char **argv) {
|
|||
DebugPrintf("give <item name>\n");
|
||||
} else {
|
||||
int index = _vm->_objectsNames->lookup(argv[1]);
|
||||
if (index != -1)
|
||||
if (index != Table::notFound)
|
||||
_vm->addInventoryItem(index + 4);
|
||||
else
|
||||
DebugPrintf("invalid item name '%s'\n", argv[1]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue