- Added an IF_KEEPDEPLETED flag for inventory items to keep them in the

player's inventory even when they have been used up. If the item also
  has an inventory bar icon, it will be drawn darkened when it is
  depleted.


SVN r497 (trunk)
This commit is contained in:
Randy Heit 2007-03-07 02:24:24 +00:00
commit e01ff5707c
12 changed files with 52 additions and 22 deletions

View file

@ -730,11 +730,16 @@ bool AActor::UseInventory (AInventory *item)
{
return false;
}
// Don't use it if you don't actually have any of it.
if (item->Amount <= 0)
{
return false;
}
if (!item->Use (false))
{
return false;
}
if (--item->Amount <= 0)
if (--item->Amount <= 0 && !(item->ItemFlags & IF_KEEPDEPLETED))
{
item->Destroy ();
}