summaryrefslogtreecommitdiff
path: root/src/map/trade.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-19 00:12:35 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-03-19 00:12:35 +0000
commit38825fa2ef87c024f88cf0ac139a02ef7fd5f40d (patch)
tree4aa62b912811a0b2921fedb759b39620b08431e2 /src/map/trade.c
parente92f5bc08714b2832c6393e3d9f652d75e69a568 (diff)
downloadhercules-38825fa2ef87c024f88cf0ac139a02ef7fd5f40d.tar.gz
hercules-38825fa2ef87c024f88cf0ac139a02ef7fd5f40d.tar.bz2
hercules-38825fa2ef87c024f88cf0ac139a02ef7fd5f40d.tar.xz
hercules-38825fa2ef87c024f88cf0ac139a02ef7fd5f40d.zip
- The last bug in Adoption system.
- Fixed a bug on trade, if you received a trade without accept it do logout... the other player cannot trade anymore 'til restart. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12396 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/trade.c')
-rw-r--r--src/map/trade.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/map/trade.c b/src/map/trade.c
index 4371bf6a8..f60f7370b 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -443,8 +443,14 @@ void trade_tradecancel(struct map_session_data *sd)
struct map_session_data *target_sd;
int trade_i;
+ target_sd = map_id2sd(sd->trade_partner);
+
if(!sd->state.trading)
+ { // Not trade acepted
+ if( target_sd ) target_sd->trade_partner = 0;
+ sd->trade_partner = 0;
return;
+ }
for(trade_i = 0; trade_i < 10; trade_i++) { // give items back (only virtual)
if (!sd->deal.item[trade_i].amount)
@@ -458,7 +464,6 @@ void trade_tradecancel(struct map_session_data *sd)
sd->deal.zeny = 0;
}
- target_sd = map_id2sd(sd->trade_partner);
sd->state.deal_locked = 0;
sd->state.trading = 0;
sd->trade_partner = 0;