summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-10 03:55:52 +0000
committerParadox924X <Paradox924X@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-10 03:55:52 +0000
commit9a87c5b5ad061c2f92b87feadfd8baa6ad661ba5 (patch)
treeb1b182999fa1cd9bf1a9573f44b24fe04fb282eb
parent7a3924a8e32eafe806e644770c3b470d79c1e831 (diff)
downloadhercules-9a87c5b5ad061c2f92b87feadfd8baa6ad661ba5.tar.gz
hercules-9a87c5b5ad061c2f92b87feadfd8baa6ad661ba5.tar.bz2
hercules-9a87c5b5ad061c2f92b87feadfd8baa6ad661ba5.tar.xz
hercules-9a87c5b5ad061c2f92b87feadfd8baa6ad661ba5.zip
Use packet 0xe7 instead of 0x1f5 within clif_tradestart() when there is no trade_partner (or an invalid one) specified even for PACKETVER >= 6. (bugreport:4544)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14454 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt1
-rw-r--r--src/map/clif.c29
2 files changed, 14 insertions, 16 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 43e4fce54..116b45980 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,7 @@
Date Added
2010/11/09
+ * Use packet 0xe7 instead of 0x1f5 within clif_tradestart() when there is no trade_partner (or an invalid one) specified even for PACKETVER >= 6. (bugreport:4544) [Paradox924X]
* Follow-up to r14368. Load last_map from SQL on char load so the information is available during char select for PACKETVER > 20100721. Patch based on Ai4rei's. (bugreport:4429) [Paradox924X]
2010/11/08
* Notify players involved in a trade that it has been canceled when one player changes maps/logs out or otherwise becomes unable to participate in the trade. [Paradox924X]
diff --git a/src/map/clif.c b/src/map/clif.c
index 013b41376..94c19287a 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -3477,23 +3477,20 @@ void clif_traderequest(struct map_session_data* sd, const char* name)
void clif_tradestart(struct map_session_data* sd, uint8 type)
{
int fd = sd->fd;
-
-#if PACKETVER < 6
- WFIFOHEAD(fd,packet_len(0xe7));
- WFIFOW(fd,0) = 0xe7;
- WFIFOB(fd,2) = type;
- WFIFOSET(fd,packet_len(0xe7));
-#else
struct map_session_data* tsd = map_id2sd(sd->trade_partner);
- if( !tsd ) return;
-
- WFIFOHEAD(fd,packet_len(0x1f5));
- WFIFOW(fd,0) = 0x1f5;
- WFIFOB(fd,2) = type;
- WFIFOL(fd,3) = tsd->status.char_id;
- WFIFOW(fd,7) = tsd->status.base_level;
- WFIFOSET(fd,packet_len(0x1f5));
-#endif
+ if( PACKETVER < 6 || !tsd ) {
+ WFIFOHEAD(fd,packet_len(0xe7));
+ WFIFOW(fd,0) = 0xe7;
+ WFIFOB(fd,2) = type;
+ WFIFOSET(fd,packet_len(0xe7));
+ } else {
+ WFIFOHEAD(fd,packet_len(0x1f5));
+ WFIFOW(fd,0) = 0x1f5;
+ WFIFOB(fd,2) = type;
+ WFIFOL(fd,3) = tsd->status.char_id;
+ WFIFOW(fd,7) = tsd->status.base_level;
+ WFIFOSET(fd,packet_len(0x1f5));
+ }
}
/*==========================================