summaryrefslogtreecommitdiff
path: root/src/char/int_elemental.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-06-24 15:46:48 +0200
committerHaru <haru@dotalux.com>2018-06-30 01:51:09 +0200
commitbd010c4058f7973287a4083031d508aa610cb9dd (patch)
tree1accd13d38584614b58ae2ecfa64ec7c5b103eef /src/char/int_elemental.c
parenta77ed4bbf9a7afa60954c8eab6778be1840e77c5 (diff)
downloadhercules-bd010c4058f7973287a4083031d508aa610cb9dd.tar.gz
hercules-bd010c4058f7973287a4083031d508aa610cb9dd.tar.bz2
hercules-bd010c4058f7973287a4083031d508aa610cb9dd.tar.xz
hercules-bd010c4058f7973287a4083031d508aa610cb9dd.zip
Move some non-mapif functions from the mapif interface to the inter_elemental interface
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/int_elemental.c')
-rw-r--r--src/char/int_elemental.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index f847d16ae..2df30ea69 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -50,7 +50,7 @@ struct inter_elemental_interface *inter_elemental;
* @param[in,out] ele The new elemental's data.
* @retval false in case of errors.
*/
-bool mapif_elemental_create(struct s_elemental *ele)
+bool inter_elemental_create(struct s_elemental *ele)
{
nullpo_retr(false, ele);
Assert_retr(false, ele->elemental_id == 0);
@@ -73,7 +73,7 @@ bool mapif_elemental_create(struct s_elemental *ele)
* @param ele The elemental's data.
* @retval false in case of errors.
*/
-bool mapif_elemental_save(const struct s_elemental *ele)
+bool inter_elemental_save(const struct s_elemental *ele)
{
nullpo_retr(false, ele);
Assert_retr(false, ele->elemental_id > 0);
@@ -90,7 +90,8 @@ bool mapif_elemental_save(const struct s_elemental *ele)
return true;
}
-bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
+bool inter_elemental_load(int ele_id, int char_id, struct s_elemental *ele)
+{
char* data;
nullpo_retr(false, ele);
@@ -134,7 +135,8 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) {
return true;
}
-bool mapif_elemental_delete(int ele_id) {
+bool inter_elemental_delete(int ele_id)
+{
if( SQL_ERROR == SQL->Query(inter->sql_handle, "DELETE FROM `%s` WHERE `ele_id` = '%d'", elemental_db, ele_id) ) {
Sql_ShowDebug(inter->sql_handle);
return false;
@@ -162,13 +164,13 @@ void mapif_parse_elemental_create(int fd, const struct s_elemental *ele)
memcpy(&ele_, ele, sizeof(ele_));
- result = mapif->elemental_create(&ele_);
+ result = inter_elemental->create(&ele_);
mapif->elemental_send(fd, &ele_, result);
}
void mapif_parse_elemental_load(int fd, int ele_id, int char_id) {
struct s_elemental ele;
- bool result = mapif->elemental_load(ele_id, char_id, &ele);
+ bool result = inter_elemental->load(ele_id, char_id, &ele);
mapif->elemental_send(fd, &ele, result);
}
@@ -180,7 +182,7 @@ void mapif_elemental_deleted(int fd, unsigned char flag) {
}
void mapif_parse_elemental_delete(int fd, int ele_id) {
- bool result = mapif->elemental_delete(ele_id);
+ bool result = inter_elemental->delete(ele_id);
mapif->elemental_deleted(fd, result);
}
@@ -193,7 +195,7 @@ void mapif_elemental_saved(int fd, unsigned char flag) {
void mapif_parse_elemental_save(int fd, const struct s_elemental *ele)
{
- bool result = mapif->elemental_save(ele);
+ bool result = inter_elemental->save(ele);
mapif->elemental_saved(fd, result);
}
@@ -229,4 +231,9 @@ void inter_elemental_defaults(void)
inter_elemental->sql_init = inter_elemental_sql_init;
inter_elemental->sql_final = inter_elemental_sql_final;
inter_elemental->parse_frommap = inter_elemental_parse_frommap;
+
+ inter_elemental->create = inter_elemental_create;
+ inter_elemental->save = inter_elemental_save;
+ inter_elemental->load = inter_elemental_load;
+ inter_elemental->delete = inter_elemental_delete;
}