fixed SelectedItem when no item
This commit is contained in:
parent
8e64a009f5
commit
93809f5052
3 changed files with 24 additions and 6 deletions
|
|
@ -35,6 +35,15 @@ public class Inventory : ItemStorage {
|
|||
base.AddItem(item, amount);
|
||||
}
|
||||
|
||||
public override void RemoveItem(Item item, int amount)
|
||||
{
|
||||
base.RemoveItem(item, amount);
|
||||
if (!items.ContainsKey(item))
|
||||
{
|
||||
PlayerController.instance.DeselectItem();
|
||||
}
|
||||
}
|
||||
|
||||
public void SellItem(Item item, int amount) {
|
||||
PlayerController.instance.ChangeMoney(item.SellPrice);
|
||||
Shop.instance.AddItem(item, amount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue