From 2e93877e156bec25dd9ab2038ed88b35f438515b Mon Sep 17 00:00:00 2001 From: Dipesh Amin Date: Thu, 1 Sep 2011 15:35:59 +0100 Subject: If it's not going to add the item, lets make sure it cancels the trade before it can be accepted. Hopefully we can figure out what is wrong with this, but leave this their for now, so the bot doesn't "scam" people. --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index 865f4b0..139f474 100755 --- a/main.py +++ b/main.py @@ -842,6 +842,10 @@ def main(): if trader_state.item.price == 0: # getback mapserv.sendall(str(PacketOut(CMSG_TRADE_OK))) trader_state.complete = 1 + else: + mapserv.sendall(str(PacketOut(CMSG_TRADE_CANCEL_REQUEST))) + logging.info("Trade response: Trade accepted (buy) - the item could not be added.") + mapserv.sendall(whisper(trader_state.item.player, "Sorry, a problem has occured.")) elif trader_state.money: # money amount = int(user_tree.get_user(trader_state.money).get('money')) -- cgit v1.2.3-70-g09d2