diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-14 23:28:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-29 20:59:31 +0300 |
commit | b55eddc4e2fad482ea89b904f0c56ca258493bf0 (patch) | |
tree | 4ae891f7aa870b1d210934f9d4d00503a58e666d /src | |
parent | 6cdc68d45c5bfe45f0be72d8b1da143ed2a50975 (diff) | |
download | hercules-b55eddc4e2fad482ea89b904f0c56ca258493bf0.tar.gz hercules-b55eddc4e2fad482ea89b904f0c56ca258493bf0.tar.bz2 hercules-b55eddc4e2fad482ea89b904f0c56ca258493bf0.tar.xz hercules-b55eddc4e2fad482ea89b904f0c56ca258493bf0.zip |
Simplify version checks with new packet version defines.
Diffstat (limited to 'src')
-rw-r--r-- | src/char/char.c | 2 | ||||
-rw-r--r-- | src/map/clif.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/char/char.c b/src/char/char.c index 0069e7f1d..93fb1be75 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -3328,7 +3328,7 @@ void char_char_name_ack(int fd, int char_id) WFIFOHEAD(fd,30); WFIFOW(fd,0) = 0x2b09; WFIFOL(fd,2) = char_id; -#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) +#if PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221 if (chr->loadName(char_id, WFIFOP(fd,6)) == 0) WFIFOL(fd, 6) = 0; #else diff --git a/src/map/clif.c b/src/map/clif.c index cf5edd0e0..f5adde873 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -6092,7 +6092,7 @@ void clif_wis_end(int fd, int flag) { void clif_solved_charname(int fd, int charid, const char* name) { nullpo_retv(name); -#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) +#if PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221 WFIFOHEAD(fd, packet_len(0x0af7)); WFIFOW(fd, 0) = 0xaf7; if (*name == 0) { @@ -14218,10 +14218,8 @@ void clif_friendslist_toggle(struct map_session_data *sd,int account_id, int cha WFIFOL(fd, 2) = sd->status.friends[i].account_id; WFIFOL(fd, 6) = sd->status.friends[i].char_id; WFIFOB(fd, 10) = !online; //Yeah, a 1 here means "logged off", go figure... -#ifndef PACKETVER_ZERO -#if PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221) +#if PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221 memcpy(WFIFOP(fd, 11), sd->status.friends[i].name, NAME_LENGTH); -#endif #endif // PACKETVER_ZERO WFIFOSET(fd, packet_len(0x206)); @@ -14245,7 +14243,7 @@ void clif_friendslist_send(struct map_session_data *sd) { int i = 0, n, fd = sd->fd; -#if !defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221)) +#if PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221 const int offset = 8; #else const int offset = 32; @@ -14257,7 +14255,7 @@ void clif_friendslist_send(struct map_session_data *sd) for(i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id; i++) { WFIFOL(fd, 4 + offset * i + 0) = sd->status.friends[i].account_id; WFIFOL(fd, 4 + offset * i + 4) = sd->status.friends[i].char_id; -#if !(!defined(PACKETVER_ZERO) && (PACKETVER >= 20180307 || (defined(PACKETVER_RE) && PACKETVER >= 20180221))) +#if !(PACKETVER_MAIN_NUM >= 20180307 || PACKETVER_RE_NUM >= 20180221) memcpy(WFIFOP(fd, 4 + offset * i + 8), &sd->status.friends[i].name, NAME_LENGTH); #endif } |