Commit e6097269 authored by salix5's avatar salix5

DataManager::FormatLocation()

parent 5bd86a82
......@@ -22,6 +22,7 @@ ClientCard::ClientCard() {
cmdFlag = 0;
code = 0;
chain_code = 0;
location = 0;
type = 0;
alias = 0;
level = 0;
......
......@@ -219,11 +219,10 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
else
return GetSysString(1009);
}
int filter = 1, i = 1000;
while(filter != location) {
filter <<= 1;
i++;
}
unsigned filter = 1;
int i = 1000;
for(; filter != 0x100 && filter != location; filter <<= 1)
++i;
if(filter == location)
return GetSysString(i);
else
......@@ -231,7 +230,8 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
}
const wchar_t* DataManager::FormatAttribute(int attribute) {
wchar_t* p = attBuffer;
int filter = 1, i = 1010;
unsigned filter = 1;
int i = 1010;
for(; filter != 0x80; filter <<= 1, ++i) {
if(attribute & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
......@@ -247,7 +247,8 @@ const wchar_t* DataManager::FormatAttribute(int attribute) {
}
const wchar_t* DataManager::FormatRace(int race) {
wchar_t* p = racBuffer;
int filter = 1, i = 1020;
unsigned filter = 1;
int i = 1020;
for(; filter != 0x1000000; filter <<= 1, ++i) {
if(race & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
......@@ -263,7 +264,8 @@ const wchar_t* DataManager::FormatRace(int race) {
}
const wchar_t* DataManager::FormatType(int type) {
wchar_t* p = tpBuffer;
int filter = 1, i = 1050;
unsigned filter = 1;
int i = 1050;
for(; filter != 0x2000000; filter <<= 1, ++i) {
if(type & filter) {
BufferIO::CopyWStrRef(GetSysString(i), p, 16);
......
Subproject commit 95bc5de881cc3b0b6108b0236ecce197a40af5b3
Subproject commit 627ee5b3721037d4ffc0b5f3e6db67ae10c53bb9
Subproject commit eda89570a613c7ba4e7e23a36b2c66a8420cbc61
Subproject commit c0d5188ed0ae14a5497276978fb65d3a67bf8095
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