Skip to content

Commit

Permalink
manipulator: Sort custom professions
Browse files Browse the repository at this point in the history
Also use == instead of string::compare()
  • Loading branch information
lethosor committed Dec 16, 2016
1 parent 7b2e6f2 commit a5eb5d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/manipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,15 +647,15 @@ struct ProfessionTemplate
name = line.substr(nextInd + 1);
continue;
}
if (line.compare("MASK")==0)
if (line == "MASK")
{
mask = true;
continue;
}

for (int i = 0; i < NUM_COLUMNS; i++)
{
if (line.compare(ENUM_KEY_STR(unit_labor, columns[i].labor)) == 0)
if (line == ENUM_KEY_STR(unit_labor, columns[i].labor))
{
labors.push_back(columns[i].labor);
}
Expand Down Expand Up @@ -743,9 +743,10 @@ class ProfessionTemplateManager
return;
}
Filesystem::listdir(professions_folder, files);
std::sort(files.begin(), files.end());
for(size_t i = 0; i < files.size(); i++)
{
if (files[i].compare(".") == 0 || files[i].compare("..") == 0)
if (files[i] == "." || files[i] == "..")
continue;

ProfessionTemplate t;
Expand Down

0 comments on commit a5eb5d2

Please sign in to comment.