diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-02-22 14:52:35 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-02-22 14:52:35 -0700 |
commit | 02bd75d7617eb511db93e58eeb3a734d66d0c099 (patch) | |
tree | c77e16fb8d206380b9f98655658a8cf7445f68df | |
parent | b152e7e73348473517a58f3ad005fbc3d89fc541 (diff) | |
download | tmwa-02bd75d7617eb511db93e58eeb3a734d66d0c099.tar.gz tmwa-02bd75d7617eb511db93e58eeb3a734d66d0c099.tar.bz2 tmwa-02bd75d7617eb511db93e58eeb3a734d66d0c099.tar.xz tmwa-02bd75d7617eb511db93e58eeb3a734d66d0c099.zip |
Fix trade ug that caused money loss
-rw-r--r-- | src/map/trade.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/trade.c b/src/map/trade.c index 5f924e0..20f1882 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -287,18 +287,20 @@ void trade_tradecommit(struct map_session_data *sd) } } if(sd->deal_zeny) { - sd->status.zeny -= sd->deal_zeny; + int deal = sd->deal_zeny; + sd->deal_zeny=0; + sd->status.zeny -= deal; clif_updatestatus(sd,SP_ZENY); - target_sd->status.zeny += sd->deal_zeny; + target_sd->status.zeny += deal; clif_updatestatus(target_sd,SP_ZENY); - sd->deal_zeny=0; } if(target_sd->deal_zeny) { - target_sd->status.zeny -= target_sd->deal_zeny; + int deal = target_sd->deal_zeny; + target_sd->deal_zeny=0; + target_sd->status.zeny -= deal; clif_updatestatus(target_sd,SP_ZENY); - sd->status.zeny += target_sd->deal_zeny; + sd->status.zeny += deal; clif_updatestatus(sd,SP_ZENY); - target_sd->deal_zeny=0; } sd->deal_locked =0; sd->trade_partner=0; |