summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-09-01 15:35:59 +0100
committerDipesh Amin <yaypunkrock@gmail.com>2011-09-01 15:35:59 +0100
commit2e93877e156bec25dd9ab2038ed88b35f438515b (patch)
treef36a6da2202801e7aa4400a7222277fc4c572781
parentf2c66d5930646d7efea74a1693481827cfea18e6 (diff)
downloadmanamarket-2e93877e156bec25dd9ab2038ed88b35f438515b.tar.gz
manamarket-2e93877e156bec25dd9ab2038ed88b35f438515b.tar.bz2
manamarket-2e93877e156bec25dd9ab2038ed88b35f438515b.tar.xz
manamarket-2e93877e156bec25dd9ab2038ed88b35f438515b.zip
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.
-rwxr-xr-xmain.py4
1 files changed, 4 insertions, 0 deletions
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'))