summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-07 03:24:06 +0100
committerHaru <haru@dotalux.com>2016-02-24 19:40:31 +0100
commita9326b175d42b9f6448d97b52108be907194854c (patch)
tree91c9b0e594217bf54130709beeed588f6d830a5a /src/map/clif.c
parent9ee06831aec11a8ffea77f3b5c81465579f993e9 (diff)
downloadhercules-a9326b175d42b9f6448d97b52108be907194854c.tar.gz
hercules-a9326b175d42b9f6448d97b52108be907194854c.tar.bz2
hercules-a9326b175d42b9f6448d97b52108be907194854c.tar.xz
hercules-a9326b175d42b9f6448d97b52108be907194854c.zip
Added const qualifier to the {RFIFO,RBUF}{B,W,L,Q} families
A read FIFO/buffer should be, well, read-only. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a7d73d91f..a7d7dca97 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18787,7 +18787,9 @@ int clif_parse(int fd) {
return 0; // not enough data received to form the packet
if( battle_config.packet_obfuscation == 2 || cmd != RFIFOW(fd, 0) || (sd && sd->parse_cmd_func == clif_parse_cmd_decrypt) ) {
- RFIFOW(fd, 0) = cmd;
+ // Note: Overriding const qualifier to re-inject the decoded packet ID.
+ int16 *packet_id = (int16 *)RFIFOP(fd, 0);
+ *packet_id = cmd;
if( sd ) {
sd->cryptKey = (( sd->cryptKey * clif->cryptKey[1] ) + clif->cryptKey[2]) & 0xFFFFFFFF; // Update key for the next packet
}