From d32a8c1db45634fb2817bc2b8575171f8b478e33 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Jun 2016 23:52:06 +0300 Subject: Add constant MAX_SLOTS into script constants. --- src/emap/init.c | 1 + src/emap/script.c | 7 +++++++ src/emap/script.h | 1 + 3 files changed, 9 insertions(+) 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, -- cgit v1.2.3-70-g09d2