From 2caac2d05e8b40b13b4a03a1186d2ce8e1fc10df Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Thu, 1 Sep 2011 13:30:04 +0100 Subject: oops quite a big one also had some duplication. --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 0c3cd99..3df8f1c 100755 --- a/main.py +++ b/main.py @@ -152,8 +152,6 @@ def process_whisper(nick, msg, mapserv): mapserv.sendall(whisper(nick, "!list - Displays a list of all items for sale.")) elif broken_string[1] == '!find': mapserv.sendall(whisper(nick, "!find or - Simple search to locate an item.")) - elif broken_string[1] == '!buy': - mapserv.sendall(whisper(nick, "!buy - Request the purchase of an item or items.")) elif broken_string[1] == '!add': mapserv.sendall(whisper(nick, "!add - Add an item to the sell list (requires that you have an account).")) elif broken_string[1] == '!money': @@ -432,11 +430,12 @@ def process_whisper(nick, msg, mapserv): item.uid = uid item.amount = amount item.price = int(item_info.get("price")) - trader_state.item = item if not trader_state.Trading.testandset(): mapserv.sendall(whisper(nick, "I'm currently busy with a trade. Try again shortly")) return + + trader_state.item = item player_id = beingManager.findId(nick) if player_id != -10: mapserv.sendall(trade_request(player_id)) @@ -533,11 +532,12 @@ def process_whisper(nick, msg, mapserv): item.uid = uid item.amount = int(item_info.get("amount")) item.price = 0 - trader_state.item = item - + if not trader_state.Trading.testandset(): mapserv.sendall(whisper(nick, "I'm currently busy with a trade. Try again shortly")) return + + trader_state.item = item player_id = beingManager.findId(nick) if player_id != -10: mapserv.sendall(trade_request(player_id)) -- cgit v1.2.3-70-g09d2