diff --git a/src/xrServerEntities/script_ini_file.cpp b/src/xrServerEntities/script_ini_file.cpp index b8bd62e4755..e3ea1e44fea 100644 --- a/src/xrServerEntities/script_ini_file.cpp +++ b/src/xrServerEntities/script_ini_file.cpp @@ -15,14 +15,18 @@ 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) +{ +} CScriptIniFile::~CScriptIniFile() {} -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 47fbc8d500f..8ceb96db241 100644 --- a/src/xrServerEntities/script_ini_file.h +++ b/src/xrServerEntities/script_ini_file.h @@ -18,6 +18,7 @@ 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); virtual ~CScriptIniFile(); bool line_exist(LPCSTR S, LPCSTR L); bool section_exist(LPCSTR S); @@ -25,7 +26,7 @@ class CScriptIniFile : public CInifile bool r_bool(LPCSTR S, LPCSTR L); int r_token(LPCSTR S, LPCSTR L, const CScriptTokenList& token_list); LPCSTR r_string_wb(LPCSTR S, LPCSTR L); - 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 58b0aa7d719..78cd748d678 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)