summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRawng <rawng.github@gmail.com>2015-06-01 21:54:40 -0400
committerRawng <rawng.github@gmail.com>2015-06-01 21:54:40 -0400
commitf038c11f6b150997d29303569e8acb0bb73d64d2 (patch)
tree6df84a51ff2b9b2d05f1a0a4015aa61ec7446904
parent1e8140f0f62ecfd0ccbe046cf6ea9faed926f327 (diff)
downloadmanamarket-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
-rwxr-xr-xmain.py1
-rw-r--r--player.py5
-rw-r--r--storage.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/main.py b/main.py
index 21fddff..58354ae 100755
--- a/main.py
+++ b/main.py
@@ -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'))
diff --git a/player.py b/player.py
index ed80f66..d6d93a7 100644
--- a/player.py
+++ b/player.py
@@ -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):
diff --git a/storage.py b/storage.py
index 8afda66..2332fbb 100644
--- a/storage.py
+++ b/storage.py
@@ -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: