From aef0bcdbda77b07f6f99e629e0499d7e576b6741 Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Wed, 11 Apr 2012 12:56:52 +0100 Subject: Don't initiate trades, if the weight limit will be reached. --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) 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.")) -- cgit v1.2.3-70-g09d2