summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authorFate <fate-tmw@googlemail.com>2009-09-15 04:18:33 +0000
committerFate <fate-tmw@googlemail.com>2009-09-15 04:18:33 +0000
commitd7b6afc444c1fac508dd5cc4bdf7e4dfa57e50c2 (patch)
tree76038aa2226d3bf2d87c4b2d50e83ac0ad1cc248 /src/map/trade.c
parent1000c71d10076fcb51280d7bb90144e2570ba569 (diff)
downloadtmwa-d7b6afc444c1fac508dd5cc4bdf7e4dfa57e50c2.tar.gz
tmwa-d7b6afc444c1fac508dd5cc4bdf7e4dfa57e50c2.tar.bz2
tmwa-d7b6afc444c1fac508dd5cc4bdf7e4dfa57e50c2.tar.xz
tmwa-d7b6afc444c1fac508dd5cc4bdf7e4dfa57e50c2.zip
Logging fix and extension to include trade informaiton
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 67ac257..31f29ce 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -244,6 +244,8 @@ void trade_tradecancel(struct map_session_data *sd)
}
}
+#define MAP_LOG_PC(sd, fmt, args...) MAP_LOG("PC%d %d:%d,%d " fmt, sd->status.char_id, sd->bl.m, sd->bl.x, sd->bl.y, ## args)
+
/*==========================================
* Žๆˆ๘‹–‘๘(trade‰Ÿ‚ต)
*------------------------------------------
@@ -256,17 +258,20 @@ void trade_tradecommit(struct map_session_data *sd)
nullpo_retv(sd);
if((target_sd = map_id2sd(sd->trade_partner)) != NULL){
+ MAP_LOG_PC(sd, " TRADECOMMIT WITH %d GIVE %d GET %d", target_sd->status.char_id, sd->deal_zeny, target_sd->deal_zeny);
if( (sd->deal_locked >=1) && (target_sd->deal_locked >=1) ){ // both have pressed 'ok'
if(sd->deal_locked < 2) {sd->deal_locked=2;} // set locked to 2
if(target_sd->deal_locked==2) { // the other one pressed 'trade' too
if(sd->deal_zeny > sd->status.zeny) {
sd->deal_zeny = 0;
trade_tradecancel(sd);
+ MAP_LOG_PC(sd, " TRADECANCEL");
return;
}
if(target_sd->deal_zeny > target_sd->status.zeny) {
target_sd->deal_zeny = 0;
trade_tradecancel(sd);
+ MAP_LOG_PC(sd, " TRADECANCEL");
return;
}
for(trade_i=0; trade_i<10;trade_i++) {
@@ -315,6 +320,7 @@ void trade_tradecommit(struct map_session_data *sd)
target_sd->trade_partner=0;
clif_tradecompleted(sd,0);
clif_tradecompleted(target_sd,0);
+ MAP_LOG_PC(sd, " TRADEOK");
}
}
}