mirror of
https://github.com/mangosfour/server.git
synced 2025-12-24 19:37:07 +00:00
Code change for the acquisition of the locale
The original code was making use of a structure that is used for races (Human, Orc, etc), which was rather an odd thing to do. Seeing as the code would not work in this core, I took the opportunity to rewrite it so that it checked that actual local file instead.
This commit is contained in:
parent
3a9b00aafd
commit
95f9c41ab0
3 changed files with 47 additions and 2 deletions
|
|
@ -289,6 +289,23 @@ static bool ReadDBCBuildFileText(const std::string& dbc_path, char const* locale
|
|||
return false;
|
||||
}
|
||||
|
||||
int ReadDBCLocale(const std::string sDataPath)
|
||||
{
|
||||
std::string sDBCpath = sDataPath + "dbc/";
|
||||
std::string sFilename;
|
||||
|
||||
for (int uLocaleIndex = 0; uLocaleIndex < MAX_LOCALE; ++uLocaleIndex)
|
||||
{
|
||||
sFilename = sDBCpath + "component.wow-" + fullLocaleNameList[uLocaleIndex].name + ".txt";
|
||||
if (FILE* file = fopen(sFilename.c_str(), "rb"))
|
||||
{
|
||||
return uLocaleIndex; // Successfully located the locale
|
||||
}
|
||||
}
|
||||
|
||||
return -1; // Failed to locate or access the component.wow<locale>.txt file
|
||||
}
|
||||
|
||||
static uint32 ReadDBCBuild(const std::string& dbc_path, LocaleNameStr const*&localeNameStr)
|
||||
{
|
||||
std::string text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue