summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-06-21 23:52:06 +0300
committerAndrei Karas <akaras@inbox.ru>2016-06-21 23:52:06 +0300
commitd32a8c1db45634fb2817bc2b8575171f8b478e33 (patch)
treeb7f3c4f1610c65119ffda03cd8b989967d93e7ae /src
parent0837129c403ddbf56e581b97d4878e85ac1c4489 (diff)
downloadevol-hercules-d32a8c1db45634fb2817bc2b8575171f8b478e33.tar.gz
evol-hercules-d32a8c1db45634fb2817bc2b8575171f8b478e33.tar.bz2
evol-hercules-d32a8c1db45634fb2817bc2b8575171f8b478e33.tar.xz
evol-hercules-d32a8c1db45634fb2817bc2b8575171f8b478e33.zip
Add constant MAX_SLOTS into script constants.
Diffstat (limited to 'src')
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script.c7
-rw-r--r--src/emap/script.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 8c9600f..fb9da26 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -250,6 +250,7 @@ HPExport void plugin_init (void)
addHookPre(script, reload, escript_reload_pre);
addHookPre(script, load_translations, escript_load_translations_pre);
addHookPre(script, load_parameters, escript_load_parameters_pre);
+ addHookPre(script, hardcoded_constants, escript_hardcoded_constants_pre);
addHookPre(status, calc_pc_additional, estatus_calc_pc_additional_pre);
addHookPost(clif, addcards, eclif_addcards_post);
diff --git a/src/emap/script.c b/src/emap/script.c
index 9f19693..e3ad3ed 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -79,6 +79,13 @@ void escript_load_parameters_pre(void)
script->constdb_comment(NULL);
}
+void escript_hardcoded_constants_pre(void)
+{
+ script->constdb_comment("Evol constants");
+ script->set_constant("MAX_SLOTS", MAX_SLOTS, false, false);
+ script->constdb_comment(NULL);
+}
+
// stripped copy from script_load_translations without actual translation loading.
void escript_load_translations_pre(void)
{
diff --git a/src/emap/script.h b/src/emap/script.h
index 3985dcf..cd29816 100644
--- a/src/emap/script.h
+++ b/src/emap/script.h
@@ -7,6 +7,7 @@
int escript_reload_pre(void);
void escript_load_translations_pre(void);
void escript_load_parameters_pre(void);
+void escript_hardcoded_constants_pre(void);
void eset_reg_npcscope_num_pre(struct script_state **stPtr,
struct reg_db **nPtr,
int64 *numPtr,