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:
Nicola Mettifogo 2007-08-13 23:17:17 +00:00
parent 9694215490
commit a2a450dfae
7 changed files with 16 additions and 13 deletions

View file

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