diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-24 12:05:30 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2011-08-24 12:05:30 +0100 |
commit | 80d3df45dc769fe7e553caaea2ab938e94cbf07b (patch) | |
tree | 8069cc67053c423221b59f242eaeb20e227a9c3e /player.py | |
parent | 8029332e70ed71ca386c5f411f9ab138a26a53c5 (diff) | |
download | manamarket-80d3df45dc769fe7e553caaea2ab938e94cbf07b.tar.gz manamarket-80d3df45dc769fe7e553caaea2ab938e94cbf07b.tar.bz2 manamarket-80d3df45dc769fe7e553caaea2ab938e94cbf07b.tar.xz manamarket-80d3df45dc769fe7e553caaea2ab938e94cbf07b.zip |
Further clean up, also fixed a tiny bug (wrong variable name).
I move the remove item logic to player.py and have skipped some of
inventory/equiptment information provided by the server.
Diffstat (limited to 'player.py')
-rw-r--r-- | player.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -38,6 +38,12 @@ class Player: return item return -10 # Not found - bug somewhere! + def remove_item(self, index, amount): + if index in self.inventory: + self.inventory[index].amount -= amount + if self.inventory[index].amount == 0: + del self.inventory[index] + def check_inventory(self, user_tree, sale_tree): # Check the inventory state. test_node = self.inventory.copy() |