summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: