diff options
author | Dipesh Amin <yaypunkrock@gmail.com> | 2012-04-11 12:56:52 +0100 |
---|---|---|
committer | Dipesh Amin <yaypunkrock@gmail.com> | 2012-04-11 12:56:52 +0100 |
commit | aef0bcdbda77b07f6f99e629e0499d7e576b6741 (patch) | |
tree | c5b9e4d44162d9f26c80d00b857b637f00f31656 | |
parent | 5079421781f84f353676d9caa95edec7c799e883 (diff) | |
download | manamarket-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-x | main.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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.")) |