- 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:
parent
560d4f8140
commit
e01ff5707c
12 changed files with 52 additions and 22 deletions
|
|
@ -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 ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue