Don't block keys from being picked up when inventory is full.
This commit is contained in:
parent
22a01ea5a0
commit
c240449530
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue