Commit 6a2deaac authored by Chen Bill's avatar Chen Bill Committed by GitHub

fix DataManager::FormatLocation (#2594)

parent a08631db
......@@ -282,8 +282,8 @@ const wchar_t* DataManager::GetNumString(int num, bool bracket) {
*++p = 0;
return numBuffer;
}
const wchar_t* DataManager::FormatLocation(int location, int sequence) {
if(location == 0x8) {
const wchar_t* DataManager::FormatLocation(int location, int sequence) const {
if(location == LOCATION_SZONE) {
if(sequence < 5)
return GetSysString(1003);
else if(sequence == 5)
......@@ -291,12 +291,16 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
else
return GetSysString(1009);
}
unsigned filter = 1;
int i = 1000;
for(; filter != 0x100 && filter != location; filter <<= 1)
++i;
if(filter == location)
return GetSysString(i);
int string_id = 0;
for (unsigned filter = LOCATION_DECK; filter <= LOCATION_PZONE; filter <<= 1, ++i) {
if (filter == location) {
string_id = i;
break;
}
}
if (string_id)
return GetSysString(string_id);
else
return unknown_string;
}
......
......@@ -32,7 +32,7 @@ public:
const wchar_t* GetSetName(int code) const;
std::vector<unsigned int> GetSetCodes(std::wstring setname) const;
const wchar_t* GetNumString(int num, bool bracket = false);
const wchar_t* FormatLocation(int location, int sequence);
const wchar_t* FormatLocation(int location, int sequence) const;
const wchar_t* FormatAttribute(int attribute);
const wchar_t* FormatRace(int race);
const wchar_t* FormatType(int type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment