summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-14 17:51:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-14 17:51:04 +0300
commit555d55b9f08d7f60a967c7d914933a92f31016bc (patch)
treea453acd60753f3f680e11885f38c1a865c41c187
parentf57a705e52b4a21a6e34c93871f689ef971d885f (diff)
downloadevol-hercules-555d55b9f08d7f60a967c7d914933a92f31016bc.tar.gz
evol-hercules-555d55b9f08d7f60a967c7d914933a92f31016bc.tar.bz2
evol-hercules-555d55b9f08d7f60a967c7d914933a92f31016bc.tar.xz
evol-hercules-555d55b9f08d7f60a967c7d914933a92f31016bc.zip
Disable completly buildin hercules translation support.
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script.c34
-rw-r--r--src/emap/script.h1
3 files changed, 36 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index e6e3556..f89829f 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -226,6 +226,7 @@ HPExport void plugin_init (void)
addHookPre("script->set_reg_npc_str", eset_reg_npcscope_str);
addHookPre("script->set_reg_ref_str", eset_reg_npcscope_str);
addHookPre("script->reload", escript_reload);
+ addHookPre("script->load_translations", escript_load_translations);
addHookPre("status->calc_pc_additional", estatus_calc_pc_additional);
addHookPost("clif->getareachar_unit", eclif_getareachar_unit_post);
diff --git a/src/emap/script.c b/src/emap/script.c
index 74f908e..4b60fe7 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -94,6 +94,40 @@ int escript_reload(void)
return 0;
}
+// stripped copy from script_load_translations without actual translation loading.
+void escript_load_translations(void)
+{
+ if (map->minimal)
+ {
+ hookStop();
+ return;
+ }
+
+ script->translation_db = strdb_alloc(DB_OPT_DUP_KEY, NAME_LENGTH * 2 + 1);
+
+ if (script->languages)
+ {
+ int i;
+ for (i = 0; i < script->max_lang_id; i++)
+ aFree(script->languages[i]);
+ aFree(script->languages);
+ }
+ script->languages = NULL;
+ script->max_lang_id = 0;
+
+ script->add_language("English");
+
+ if (script->string_list)
+ aFree(script->string_list);
+
+ script->string_list = NULL;
+ script->string_list_pos = 0;
+ script->string_list_size = 0;
+
+ map->default_lang_id = 0;
+ hookStop();
+}
+
void eset_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 *num, const char* name, int *val)
{
if (!strcmp(name, ".lang"))
diff --git a/src/emap/script.h b/src/emap/script.h
index af851f7..feae1c0 100644
--- a/src/emap/script.h
+++ b/src/emap/script.h
@@ -5,6 +5,7 @@
#define EVOL_MAP_SCRIPT
int escript_reload(void);
+void escript_load_translations(void);
void eset_reg_npcscope_num(struct script_state* st, struct reg_db *n, int64 *num, const char* name, int *val);
int eget_val_npcscope_num(struct script_state* st, struct reg_db *n, struct script_data* data);
void eset_reg_npcscope_str(struct script_state* st, struct reg_db *n, int64 *num, const char* name, const char *str);