diff --git a/src/xrServerEntities/script_ini_file.cpp b/src/xrServerEntities/script_ini_file.cpp index 29727bebe2a..72c759aa387 100644 --- a/src/xrServerEntities/script_ini_file.cpp +++ b/src/xrServerEntities/script_ini_file.cpp @@ -15,13 +15,17 @@ CScriptIniFile::CScriptIniFile(IReader* F, LPCSTR path) : inherited(F, path) {} CScriptIniFile::CScriptIniFile(LPCSTR szFileName, BOOL ReadOnly, BOOL bLoadAtStart, BOOL SaveAtEnd) - : inherited(update(szFileName), ReadOnly, bLoadAtStart, SaveAtEnd) + : inherited(update("$game_config$", szFileName), ReadOnly, bLoadAtStart, SaveAtEnd) {} +CScriptIniFile::CScriptIniFile(LPCSTR initial, LPCSTR szFileName, BOOL ReadOnly, BOOL bLoadAtStart, BOOL SaveAtEnd) + : inherited(update(initial, szFileName), ReadOnly, bLoadAtStart, SaveAtEnd) +{ +} -LPCSTR CScriptIniFile::update(LPCSTR file_name) +LPCSTR CScriptIniFile::update(LPCSTR initial, LPCSTR file_name) { string_path S1; - FS.update_path(S1, "$game_config$", file_name); + FS.update_path(S1, initial, file_name); return *shared_str(S1); } diff --git a/src/xrServerEntities/script_ini_file.h b/src/xrServerEntities/script_ini_file.h index 93ba5cfd262..94d0c183cb9 100644 --- a/src/xrServerEntities/script_ini_file.h +++ b/src/xrServerEntities/script_ini_file.h @@ -18,10 +18,11 @@ class CScriptIniFile : public CInifile public: CScriptIniFile(IReader* F, LPCSTR path = nullptr); CScriptIniFile(LPCSTR szFileName, BOOL ReadOnly = TRUE, BOOL bLoadAtStart = TRUE, BOOL SaveAtEnd = TRUE); + CScriptIniFile(LPCSTR initial, LPCSTR szFileName, BOOL ReadOnly = TRUE, BOOL bLoadAtStart = TRUE, BOOL SaveAtEnd = TRUE); int r_clsid(LPCSTR S, LPCSTR L); int r_token(LPCSTR S, LPCSTR L, const CScriptTokenList& token_list); - LPCSTR update(LPCSTR file_name); + LPCSTR update(LPCSTR initial, LPCSTR file_name); u32 line_count(LPCSTR S); LPCSTR r_string(LPCSTR S, LPCSTR L); u32 r_u32(LPCSTR S, LPCSTR L); diff --git a/src/xrServerEntities/script_ini_file_script.cpp b/src/xrServerEntities/script_ini_file_script.cpp index 941fe6a23c9..3af373bd30e 100644 --- a/src/xrServerEntities/script_ini_file_script.cpp +++ b/src/xrServerEntities/script_ini_file_script.cpp @@ -80,6 +80,7 @@ static void CScriptIniFile_Export(lua_State* luaState) [ class_("ini_file") .def(constructor()) + .def(constructor()) //Alundaio: Extend script ini file .def("w_bool", &CScriptIniFile::w_bool) .def("w_color", &CScriptIniFile::w_color)