summaryrefslogtreecommitdiff
path: root/src
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
commit84cdcd0f78c162511734466e1d1a37078ee1a786 (patch)
tree97b309e74a2e894856d38ab5a7b10dfd90fa717e /src
parentc85c24d3aa737236c15c4690b3b43d860567eac7 (diff)
downloadhercules-84cdcd0f78c162511734466e1d1a37078ee1a786.tar.gz
hercules-84cdcd0f78c162511734466e1d1a37078ee1a786.tar.bz2
hercules-84cdcd0f78c162511734466e1d1a37078ee1a786.tar.xz
hercules-84cdcd0f78c162511734466e1d1a37078ee1a786.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/branches/renewal@14454 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c29
1 files changed, 13 insertions, 16 deletions
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));
+ }
}
/*==========================================