Use directly equipped items outside the inventory

This commit is contained in:
Yohann D'ANELLO
2020-12-18 17:57:42 +01:00
parent 9475725228
commit 9aa684fb77
3 changed files with 15 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class Item(Entity):
The item is dropped from the inventory onto the floor
"""
if self.held:
self.held_by.inventory.remove(self)
self.held_by.remove_from_inventory(self)
self.held_by.map.add_entity(self)
self.move(self.held_by.y, self.held_by.x)
self.held = False
@ -46,8 +46,8 @@ class Item(Entity):
"""
if self.held_by.equipped_item:
self.held_by.equipped_item.unequip()
self.held_by.equipped_item = self
self.held_by.remove_from_inventory(self)
self.held_by.equipped_item = self
def unequip(self) -> None:
"""