summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-04 10:17:22 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-03-04 10:17:22 +0000
commit775bda16a3c02aca323df58bcc639e90e87fa789 (patch)
tree32fe2066618e598e02836992e68b464cb5efe0ff
parentabd68f2f5452c236ee5d023048c38f09764c3cd4 (diff)
downloadhercules-775bda16a3c02aca323df58bcc639e90e87fa789.tar.gz
hercules-775bda16a3c02aca323df58bcc639e90e87fa789.tar.bz2
hercules-775bda16a3c02aca323df58bcc639e90e87fa789.tar.xz
hercules-775bda16a3c02aca323df58bcc639e90e87fa789.zip
* Fixed recursive map_quit invocation when a buying store is auto-closed (login when @autotrade/logout) (bugreport:4796, since r14724).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14730 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/buyingstore.c21
2 files changed, 15 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 307423d68..36680b74f 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,5 +1,7 @@
Date Added
+2011/03/04
+ * Fixed recursive map_quit invocation when a buying store is auto-closed (login when @autotrade/logout) (bugreport:4796, since r14724). [Ai4rei]
2011/03/02
* Updates to the super novice's guardian angel prayer effect and related handling code. [Ai4rei]
- Removed the server-side chat tracking code (since r492) responsible for invoking the effect, since this functionality is handled by the client (invocation also processed by the server). This also fixes the missing 7 lines requirement on the server-side handling (bugreport:4786).
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index cf40b0231..edb0c6545 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -193,12 +193,6 @@ void buyingstore_close(struct map_session_data* sd)
// notify other players
clif_buyingstore_disappear_entry(sd);
-
- // remove auto-trader
- if( sd->state.autotrade )
- {
- map_quit(sd);
- }
}
}
@@ -388,11 +382,22 @@ void buyingstore_trade(struct map_session_data* sd, int account_id, unsigned int
if( i == pl_sd->buyingstore.slots )
{// everything was bought
clif_buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_NO_ITEMS);
- buyingstore_close(pl_sd);
}
else if( pl_sd->buyingstore.zenylimit == 0 )
{// zeny limit reached
clif_buyingstore_trade_failed_buyer(pl_sd, BUYINGSTORE_TRADE_BUYER_ZENY);
- buyingstore_close(pl_sd);
+ }
+ else
+ {// continue buying
+ return;
+ }
+
+ // cannot continue buying
+ buyingstore_close(pl_sd);
+
+ // remove auto-trader
+ if( pl_sd->state.autotrade )
+ {
+ map_quit(pl_sd);
}
}