summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDipesh Amin <yaypunkrock@gmail.com>2011-11-05 23:42:54 +0000
committerDipesh Amin <yaypunkrock@gmail.com>2011-11-05 23:42:54 +0000
commita91e699353fc5fde38583b6be21b5a454a66eac2 (patch)
treeae8669e66bfeeaa6d5de1da9059ac04e749bf1ce
parent9524a159f1756bd3c5a1a531eef263f7996eede0 (diff)
downloadmanamarket-a91e699353fc5fde38583b6be21b5a454a66eac2.tar.gz
manamarket-a91e699353fc5fde38583b6be21b5a454a66eac2.tar.bz2
manamarket-a91e699353fc5fde38583b6be21b5a454a66eac2.tar.xz
manamarket-a91e699353fc5fde38583b6be21b5a454a66eac2.zip
Fix: Player trade/logoff.
-rwxr-xr-xmain.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.py b/main.py
index 5a5d382..a37eceb 100755
--- a/main.py
+++ b/main.py
@@ -755,6 +755,17 @@ def main():
trader_state.timer = time.time()
mapserv.sendall(str(PacketOut(CMSG_TRADE_CANCEL_REQUEST)))
+ # If a player has logged off/left the map.
+ nick = ''
+ if trader_state.item:
+ nick = trader_state.item.player
+ elif trader_state.money:
+ nick = trader_state.money
+
+ player_id = beingManager.findId(nick)
+ if player_id == -10:
+ trader_state.reset()
+
for packet in pb:
if packet.is_type(SMSG_MAP_LOGIN_SUCCESS): # connected
logging.info("Map login success.")