summaryrefslogtreecommitdiff
path: root/src/char/int_elemental.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-07 03:41:22 +0100
committerHaru <haru@dotalux.com>2016-02-24 20:57:34 +0100
commit9aa8a3b09ee2c491b55259ee433af7f39308ca37 (patch)
treef23571319dc25bdcb7efd56df9fc1eab6be32588 /src/char/int_elemental.c
parent931d716e1000b50a66b012815a412619d16fc957 (diff)
downloadhercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.gz
hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.bz2
hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.tar.xz
hercules-9aa8a3b09ee2c491b55259ee433af7f39308ca37.zip
Added const qualifier to several variable/argument pointers
- This is necessary for compatibility with a const RFIFOP. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_elemental.c')
-rw-r--r--src/char/int_elemental.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index 8d868bc06..70275725d 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -155,10 +155,15 @@ void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) {
WFIFOSET(fd,size);
}
-void mapif_parse_elemental_create(int fd, struct s_elemental *ele)
+void mapif_parse_elemental_create(int fd, const struct s_elemental *ele)
{
- bool result = mapif->elemental_create(ele);
- mapif->elemental_send(fd, ele, result);
+ struct s_elemental ele_;
+ bool result;
+
+ memcpy(&ele_, ele, sizeof(ele_));
+
+ result = mapif->elemental_create(&ele_);
+ mapif->elemental_send(fd, &ele_, result);
}
void mapif_parse_elemental_load(int fd, int ele_id, int char_id) {
@@ -186,7 +191,8 @@ void mapif_elemental_saved(int fd, unsigned char flag) {
WFIFOSET(fd,3);
}
-void mapif_parse_elemental_save(int fd, struct s_elemental* ele) {
+void mapif_parse_elemental_save(int fd, const struct s_elemental *ele)
+{
bool result = mapif->elemental_save(ele);
mapif->elemental_saved(fd, result);
}