summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeistache <crie.fernanda@gmail.com>2015-03-02 00:53:27 -0300
committerMeistache <crie.fernanda@gmail.com>2015-03-02 00:53:27 -0300
commitb7e3823588ae9354daf5fc0a0cbf27b699afb7d5 (patch)
tree371ba1d897a3bcee4dba4e2123485b64790d0b09
parent96ce897f5a2173ca0528f7fb7cfb1d22ea69af55 (diff)
downloadmanamarket-github/fork/Meistache/storage.tar.gz
manamarket-github/fork/Meistache/storage.tar.bz2
manamarket-github/fork/Meistache/storage.tar.xz
manamarket-github/fork/Meistache/storage.zip
-rw-r--r--storage.py2
-rw-r--r--tradey.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/storage.py b/storage.py
index 4de818c..8afda66 100644
--- a/storage.py
+++ b/storage.py
@@ -46,7 +46,7 @@ class Storage:
if (item.amount > MAX_AMOUNT - self.storage[index].amount):
return -10
self.storage[index].amount += item.amount
- return 0
+ return index
index = len(self.storage)
self.storage[index] = item
diff --git a/tradey.py b/tradey.py
index bdeb52d..e30cbc4 100644
--- a/tradey.py
+++ b/tradey.py
@@ -177,6 +177,7 @@ class DelistedTree(ItemTree):
user.set("itemId", str(item_id))
user.set("amount", str(amount))
user.set("uid", str(self.getId()))
+ self.save()
def saveData(commitmessage = "commit"):
# This assumes the current working directory is the tradey directory.