Merge pull request #319 from edward-san/inventory

Little TakeInventory refactoring.
This commit is contained in:
coelckers 2015-04-28 22:06:31 +02:00
commit ce4adc48a7
10 changed files with 92 additions and 107 deletions

View file

@ -1049,24 +1049,7 @@ void cht_Take (player_t *player, const char *name, int amount)
}
else
{
AInventory *inventory = player->mo->FindInventory (type);
if (inventory != NULL)
{
inventory->Amount -= amount ? amount : 1;
if (inventory->Amount <= 0)
{
if (inventory->ItemFlags & IF_KEEPDEPLETED)
{
inventory->Amount = 0;
}
else
{
inventory->Destroy ();
}
}
}
player->mo->TakeInventory(type, amount ? amount : 1);
}
return;
}