diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-21 19:34:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-21 19:34:24 +0300 |
commit | 4f45fd0d497028ef66d6e4c0313e874f9fd0984b (patch) | |
tree | 812ee82762f2b6ee7cd9b49e87d7bdac87a1bc56 /src/emap | |
parent | 6b4175131b4fc9838dbab3c3a564f65338adda41 (diff) | |
download | plugin-4f45fd0d497028ef66d6e4c0313e874f9fd0984b.tar.gz plugin-4f45fd0d497028ef66d6e4c0313e874f9fd0984b.tar.bz2 plugin-4f45fd0d497028ef66d6e4c0313e874f9fd0984b.tar.xz plugin-4f45fd0d497028ef66d6e4c0313e874f9fd0984b.zip |
Fix translations on almost destroed server.
Diffstat (limited to 'src/emap')
-rw-r--r-- | src/emap/clif.c | 4 | ||||
-rw-r--r-- | src/emap/init.c | 5 | ||||
-rw-r--r-- | src/emap/lang.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c index 4de666f..24265e4 100644 --- a/src/emap/clif.c +++ b/src/emap/clif.c @@ -29,6 +29,8 @@ #include "emap/struct/mapdext.h" #include "emap/struct/sessionext.h" +extern bool isInit; + void eclif_quest_send_list(TBL_PC *sd) { if (!sd) @@ -710,7 +712,7 @@ void eclif_disp_message(struct block_list* src, int len = *lenPtr; - if (len == 0) + if (len == 0 || !isInit) return; nullpo_retv(src); diff --git a/src/emap/init.c b/src/emap/init.c index dc2d031..703b7d6 100644 --- a/src/emap/init.c +++ b/src/emap/init.c @@ -64,6 +64,7 @@ extern int langScriptId; extern int mountScriptId; +bool isInit; HPExport struct hplugin_info pinfo = { @@ -75,6 +76,7 @@ HPExport struct hplugin_info pinfo = HPExport void plugin_init (void) { + isInit = false; status_init(); addAtcommand("setskill", setSkill); @@ -233,6 +235,8 @@ HPExport void plugin_init (void) langScriptId = script->add_str("Lang"); mountScriptId = script->add_str("mount"); + + isInit = true; } HPExport void server_preinit (void) @@ -257,4 +261,5 @@ HPExport void plugin_final (void) { do_final_langs(); commonClean(); + isInit = false; } diff --git a/src/emap/lang.c b/src/emap/lang.c index 2b7267e..e50b50f 100644 --- a/src/emap/lang.c +++ b/src/emap/lang.c @@ -162,7 +162,7 @@ const char* lang_trans(const char *str, int lng, int flg) if (!str) return 0; - if (lng < 0 || lng >= lang_num) + if (lng < 0 || lng >= lang_num || !translate_db || !translate_db->get) return str; char **strings = (char **)strdb_get(translate_db, str); |