summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index cfc4992e8..e8a58fd9b 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -54,6 +54,16 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta
}
}
+ if ( sd->trade_partner != 0 ) { // If a character tries to trade to another one then cancel the previous one
+ struct map_session_data *previous_sd = map_id2sd(sd->trade_partner);
+ if( previous_sd ){
+ previous_sd->trade_partner = 0;
+ clif_tradecancelled(previous_sd);
+ } // Once cancelled then continue to the new one.
+ sd->trade_partner = 0;
+ clif_tradecancelled(sd);
+ }
+
if (target_sd->trade_partner != 0) {
clif_tradestart(sd, 2); // person is in another trade
return;