Don't block keys from being picked up when inventory is full.

This commit is contained in:
Steve 2018-03-17 16:58:14 +00:00
parent 22a01ea5a0
commit c240449530
1 changed files with 18 additions and 38 deletions

View File

@ -39,29 +39,10 @@ void initGame(void)
loadMetaInfo();
}
int getNumItemsCarried(void)
{
int rtn, i;
rtn = 0;
for (i = 0 ; i < MAX_ITEMS ; i++)
{
if (world.bob->items[i] != NULL)
{
rtn++;
}
}
return rtn;
}
int addItem(Item *item, int num)
{
int i;
if (getNumItemsCarried() < MAX_ITEMS)
{
for (i = 0 ; i < MAX_ITEMS ; i++)
{
if (item->type == ET_KEY && world.bob->items[i] != NULL && world.bob->items[i]->type == ET_KEY && strcmp(item->name, world.bob->items[i]->name) == 0)
@ -86,7 +67,6 @@ int addItem(Item *item, int num)
return 1;
}
}
}
return 0;
}