diff options
-rwxr-xr-x | main.py | 1 | ||||
-rw-r--r-- | player.py | 5 | ||||
-rw-r--r-- | storage.py | 4 |
3 files changed, 5 insertions, 5 deletions
@@ -1108,6 +1108,7 @@ def main(): mapserv.sendall(str(PacketOut(CMSG_TRADE_CANCEL_REQUEST))) logger.info("Trade response: Trade accepted (buy) - the item could not be added.") mapserv.sendall(whisper(trader_state.item.player, "Sorry, a problem has occured.")) + storage.storage_close() elif trader_state.money: # money amount = int(user_tree.get_user(trader_state.money).get('money')) @@ -29,9 +29,8 @@ class Player: def find_inventory_index(self, item_id): for item in self.inventory: - if item > 1: - if self.inventory[item].itemId == item_id: - return item + if self.inventory[item].itemId == item_id: + return item return -10 # Not found - bug somewhere! def remove_item(self, index, amount): @@ -21,13 +21,13 @@ import mutex class Storage: def __init__(self): self.storage = {} - self.timer = 0 + self.timer = time.time() self.mapserv = 0 self.Open = mutex.mutex() def reset(self): self.Open.unlock() - self.timer = 0 + self.timer = time.time() def find_storage_index(self, item_id): for item in self.storage: |