summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2012-04-11 12:56:52 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2012-04-11 12:56:52 +0100
commitaef0bcdbda77b07f6f99e629e0499d7e576b6741 (patch)
treec5b9e4d44162d9f26c80d00b857b637f00f31656
parent5079421781f84f353676d9caa95edec7c799e883 (diff)
downloadmanamarket-aef0bcdbda77b07f6f99e629e0499d7e576b6741.tar.gz
manamarket-aef0bcdbda77b07f6f99e629e0499d7e576b6741.tar.bz2
manamarket-aef0bcdbda77b07f6f99e629e0499d7e576b6741.tar.xz
manamarket-aef0bcdbda77b07f6f99e629e0499d7e576b6741.zip
Don't initiate trades, if the weight limit will be reached.
-rwxr-xr-xmain.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.py b/main.py
index 1654b3d..b13c354 100755
--- a/main.py
+++ b/main.py
@@ -441,12 +441,18 @@ def process_whisper(nick, msg, mapserv):
price = int(broken_string[2])
item_name = " ".join(broken_string[3:])
item_id = ItemDB.findId(item_name)
+
+ weight = ItemDB.item_names[item_id].weight*amount
+
if item_id == -10:
mapserv.sendall(whisper(nick, "Item not found, check spelling."))
return
elif item_id in config.nosell:
mapserv.sendall(whisper(nick, "That item can't be added to ManaMarket, as its too heavy."))
return
+ elif weight + player_node.WEIGHT > player_node.MaxWEIGHT:
+ mapserv.sendall(whisper(nick, "I've not got enough room left to carry those. Please try again later. "))
+ return
if amount > 1 and ItemDB.getItem(item_id).type != 'equip-ammo' and 'equip' in ItemDB.getItem(item_id).type:
mapserv.sendall(whisper(nick, "You can only add one piece of equipment per slot."))