summaryrefslogtreecommitdiff
path: root/src/emap
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-18 22:05:21 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-18 22:05:21 +0300
commit97d6d72723f0ff3ba89025261cf1174615fdc80d (patch)
treeda815d70e3cb5e513e9d7ab40a6444abd5b61068 /src/emap
parent388961002f81f1e8ddd5343c54d510af0ad5bdc6 (diff)
downloadevol-hercules-97d6d72723f0ff3ba89025261cf1174615fdc80d.tar.gz
evol-hercules-97d6d72723f0ff3ba89025261cf1174615fdc80d.tar.bz2
evol-hercules-97d6d72723f0ff3ba89025261cf1174615fdc80d.tar.xz
evol-hercules-97d6d72723f0ff3ba89025261cf1174615fdc80d.zip
Update for support latest hercules.
Diffstat (limited to 'src/emap')
-rw-r--r--src/emap/craftconf.c31
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/itemdb.c9
-rw-r--r--src/emap/itemdb.h2
-rw-r--r--src/emap/mob.c7
-rw-r--r--src/emap/mob.h4
-rw-r--r--src/emap/quest.c9
-rw-r--r--src/emap/quest.h2
-rw-r--r--src/emap/status.c2
-rw-r--r--src/emap/status.h2
10 files changed, 37 insertions, 32 deletions
diff --git a/src/emap/craftconf.c b/src/emap/craftconf.c
index 22c9d0f..ecab0ac 100644
--- a/src/emap/craftconf.c
+++ b/src/emap/craftconf.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "common/conf.h"
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -43,7 +44,7 @@ struct craft_db_entry *craft_create_db_entry(const int id)
return entry;
}
-static bool craft_lookup_const(const config_setting_t *it, const char *name, int *value)
+static bool craft_lookup_const(const struct config_setting_t *it, const char *name, int *value)
{
if (libconfig->setting_lookup_int(it, name, value))
{
@@ -61,7 +62,7 @@ static bool craft_lookup_const(const config_setting_t *it, const char *name, int
return false;
}
-static bool craft_get_const(const config_setting_t *it, int *value)
+static bool craft_get_const(const struct config_setting_t *it, int *value)
{
const char *str = libconfig->setting_get_string(it);
if (str && *str && script->get_constant(str, value))
@@ -89,14 +90,14 @@ static int craft_get_item_id(struct craft_db_entry *entry,
}
static void craft_read_source_inventory(struct craft_db_entry *entry,
- config_setting_t *tt)
+ struct config_setting_t *tt)
{
int i32;
int i = 0;
if (!tt || !config_setting_is_group(tt))
return;
- config_setting_t *item;
+ struct config_setting_t *item;
int invLen = VECTOR_LENGTH(entry->inventories);
VECTOR_ENSURE(entry->inventories, invLen + 1, 1);
@@ -134,14 +135,14 @@ static void craft_read_source_inventory(struct craft_db_entry *entry,
}
static void craft_read_create_items(struct craft_db_entry *entry,
- config_setting_t *tt)
+ struct config_setting_t *tt)
{
int i32;
int i = 0;
if (!tt || !config_setting_is_group(tt))
return;
- config_setting_t *item;
+ struct config_setting_t *item;
int invLen = VECTOR_LENGTH(entry->create_items);
VECTOR_ENSURE(entry->create_items, invLen + 1, 1);
@@ -183,7 +184,7 @@ static void craft_read_create_items(struct craft_db_entry *entry,
static void craft_read_items_collection(struct craft_db_entry *entry,
struct craft_items_collection *vector,
- config_setting_t *t,
+ struct config_setting_t *t,
const char *const fieldName,
enum craft_field_type fieldType)
{
@@ -192,12 +193,12 @@ static void craft_read_items_collection(struct craft_db_entry *entry,
if (!t)
return;
- config_setting_t *tt = libconfig->setting_get_member(t, fieldName);
+ struct config_setting_t *tt = libconfig->setting_get_member(t, fieldName);
if (!tt || !config_setting_is_group(tt))
return;
- config_setting_t *item;
+ struct config_setting_t *item;
int len = 0;
while((item = libconfig->setting_get_elem(tt, i)))
@@ -303,12 +304,12 @@ static void craft_read_items_collection(struct craft_db_entry *entry,
entry->var = def; \
}
-static bool craft_read_db_sub(config_setting_t *craftt, int id, const char *source)
+static bool craft_read_db_sub(struct config_setting_t *craftt, int id, const char *source)
{
int class_;
int i32;
const char *str = NULL;
- config_setting_t *t;
+ struct config_setting_t *t;
if (!libconfig->setting_lookup_int(craftt, "Id", &class_))
{
@@ -369,16 +370,16 @@ static bool craft_read_db_sub(config_setting_t *craftt, int id, const char *sour
static void load_craft_db(const char *filename)
{
- config_t craft_db_conf;
+ struct config_t craft_db_conf;
char filepath[256];
- config_setting_t *cdb;
- config_setting_t *t;
+ struct config_setting_t *cdb;
+ struct config_setting_t *t;
int i = 0;
nullpo_retv(filename);
sprintf(filepath, "%s/%s", map->db_path, filename);
- if (libconfig->read_file(&craft_db_conf, filepath) ||
+ if (!libconfig->load_file(&craft_db_conf, filepath) ||
!(cdb = libconfig->setting_get_member(craft_db_conf.root, "craft_db")))
{
ShowError("can't read %s\n", filepath);
diff --git a/src/emap/init.c b/src/emap/init.c
index 757d66c..9a5ca02 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "common/conf.h"
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mapindex.h"
diff --git a/src/emap/itemdb.c b/src/emap/itemdb.c
index 5fcc86b..9f3de0a 100644
--- a/src/emap/itemdb.c
+++ b/src/emap/itemdb.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "common/conf.h"
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -30,7 +31,7 @@ bool eitemdb_is_item_usable(struct item_data *item)
}
void eitemdb_readdb_additional_fields(int *itemid,
- config_setting_t *it,
+ struct config_setting_t *it,
int *n __attribute__ ((unused)),
const char *source)
{
@@ -50,7 +51,7 @@ void eitemdb_readdb_additional_fields(int *itemid,
return;
}
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
if (libconfig->setting_lookup_int(it, "FloorLifeTime", &i32) && i32 >= 0)
data->floorLifeTime = i32;
@@ -129,11 +130,11 @@ void eitemdb_readdb_additional_fields(int *itemid,
if (libconfig->setting_lookup_string(it, "OnInsertCardScript", &str))
data->insertScript = *str ? script->parse(str, source, -item->nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS, NULL) : NULL;
- config_setting_t *group = libconfig->setting_get_member(it, "AllowCards");
+ struct config_setting_t *group = libconfig->setting_get_member(it, "AllowCards");
if (group)
{
int idx = 0;
- config_setting_t *it2 = NULL;
+ struct config_setting_t *it2 = NULL;
int cnt = 0;
while ((it2 = libconfig->setting_get_elem(group, idx ++)))
{
diff --git a/src/emap/itemdb.h b/src/emap/itemdb.h
index 4f0e322..3b1c651 100644
--- a/src/emap/itemdb.h
+++ b/src/emap/itemdb.h
@@ -5,7 +5,7 @@
#define EVOL_MAP_ITEMDB
bool eitemdb_is_item_usable(struct item_data *item);
-void eitemdb_readdb_additional_fields(int *itemid, config_setting_t *it, int *n, const char *source);
+void eitemdb_readdb_additional_fields(int *itemid, struct config_setting_t *it, int *n, const char *source);
void edestroy_item_data(struct item_data* self, int *free_selfPtr);
#endif // EVOL_MAP_ITEMDB
diff --git a/src/emap/mob.c b/src/emap/mob.c
index 44ffe6f..48bfdb1 100644
--- a/src/emap/mob.c
+++ b/src/emap/mob.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "common/conf.h"
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -53,7 +54,7 @@ int emob_deleteslave_sub(struct block_list *bl, va_list ap)
}
void emob_read_db_additional_fields(struct mob_db *entry,
- config_setting_t *it,
+ struct config_setting_t *it,
int *nPtr,
const char *source)
{
@@ -72,9 +73,9 @@ void emob_read_db_additional_fields(struct mob_db *entry,
int emob_read_db_mode_sub_post(int retVal,
struct mob_db *entry,
- config_setting_t *t)
+ struct config_setting_t *t)
{
- config_setting_t *t2;
+ struct config_setting_t *t2;
if ((t2 = libconfig->setting_get_member(t, "SurviveWithoutMaster")))
retVal |= libconfig->setting_get_bool(t2) ? 0x8000 : 0;
diff --git a/src/emap/mob.h b/src/emap/mob.h
index a398ea0..04d2bda 100644
--- a/src/emap/mob.h
+++ b/src/emap/mob.h
@@ -6,10 +6,10 @@
int emob_deleteslave_sub(struct block_list *bl, va_list ap);
void emob_read_db_additional_fields(struct mob_db *entry,
- config_setting_t *it,
+ struct config_setting_t *it,
int *nPtr, const char *source);
int emob_read_db_mode_sub_post(int retVal,
struct mob_db *entry,
- config_setting_t *t);
+ struct config_setting_t *t);
#endif // EVOL_MAP_MOB
diff --git a/src/emap/quest.c b/src/emap/quest.c
index 8c9efa9..15a41d8 100644
--- a/src/emap/quest.c
+++ b/src/emap/quest.c
@@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
+#include "common/conf.h"
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
@@ -27,10 +28,10 @@
* @return The parsed quest entry.
* @retval NULL in case of errors.
*/
-struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char *source)
+struct quest_db *equest_read_db_sub(struct config_setting_t *cs, int *nPtr, const char *source)
{
struct quest_db *entry = NULL;
- config_setting_t *t = NULL;
+ struct config_setting_t *t = NULL;
int i32 = 0, quest_id;
const char *str = NULL;
const int n = *nPtr;
@@ -88,7 +89,7 @@ struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char
for (i = 0; i < len && entry->objectives_count < MAX_QUEST_OBJECTIVES; i++) {
// Note: We ensure that objectives_count < MAX_QUEST_OBJECTIVES because
// quest_log (as well as the client) expect this maximum size.
- config_setting_t *tt = libconfig->setting_get_elem(t, i);
+ struct config_setting_t *tt = libconfig->setting_get_elem(t, i);
int mob_id = 0, count = 0;
if (!tt)
break;
@@ -112,7 +113,7 @@ struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char
if ((t=libconfig->setting_get_member(cs, "Drops")) && config_setting_is_list(t)) {
int i, len = libconfig->setting_length(t);
for (i = 0; i < len; i++) {
- config_setting_t *tt = libconfig->setting_get_elem(t, i);
+ struct config_setting_t *tt = libconfig->setting_get_elem(t, i);
int mob_id = 0, nameid = 0, rate = 0;
if (!tt)
break;
diff --git a/src/emap/quest.h b/src/emap/quest.h
index fd0818f..3c303ab 100644
--- a/src/emap/quest.h
+++ b/src/emap/quest.h
@@ -4,6 +4,6 @@
#ifndef EVOL_MAP_QUEST
#define EVOL_MAP_QUEST
-struct quest_db *equest_read_db_sub(config_setting_t *cs, int *nPtr, const char *source);
+struct quest_db *equest_read_db_sub(struct config_setting_t *cs, int *nPtr, const char *source);
#endif // EVOL_MAP_QUEST
diff --git a/src/emap/status.c b/src/emap/status.c
index 9575e1f..893339a 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -63,7 +63,7 @@ void estatus_set_viewdata_post(struct block_list *bl,
void estatus_read_job_db_sub(int *idxPtr,
const char *name __attribute__ ((unused)),
- config_setting_t *jdb)
+ struct config_setting_t *jdb)
{
int i32 = 0;
const int idx = *idxPtr;
diff --git a/src/emap/status.h b/src/emap/status.h
index bf40713..d81e12d 100644
--- a/src/emap/status.h
+++ b/src/emap/status.h
@@ -6,7 +6,7 @@
void status_init(void);
void estatus_set_viewdata_post(struct block_list *bl, int *class_);
-void estatus_read_job_db_sub(int *idxPtr, const char *name, config_setting_t *jdb);
+void estatus_read_job_db_sub(int *idxPtr, const char *name, struct config_setting_t *jdb);
int estatus_calc_pc__post(int retVal, struct map_session_data* sd, enum e_status_calc_opt *opt);
int estatus_calc_pc_additional(struct map_session_data* sd, enum e_status_calc_opt *opt);
unsigned short estatus_calc_speed_post(unsigned short retVal, struct block_list *bl, struct status_change *sc, int *speed);