diff options
author | Rawng <rawng.github@gmail.com> | 2015-06-01 21:54:40 -0400 |
---|---|---|
committer | Rawng <rawng.github@gmail.com> | 2015-06-01 21:54:40 -0400 |
commit | f038c11f6b150997d29303569e8acb0bb73d64d2 (patch) | |
tree | 6df84a51ff2b9b2d05f1a0a4015aa61ec7446904 | |
parent | 1e8140f0f62ecfd0ccbe046cf6ea9faed926f327 (diff) | |
download | manamarket-github/fork/Rawng/master.tar.gz manamarket-github/fork/Rawng/master.tar.bz2 manamarket-github/fork/Rawng/master.tar.xz manamarket-github/fork/Rawng/master.zip |
attempt 1github/fork/Rawng/master
-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: |