Skip to content

Commit

Permalink
Use the QStringLiteral() macro to make string literals comparable to …
Browse files Browse the repository at this point in the history
…QStringView in map_template.cpp
  • Loading branch information
Andrettin committed Feb 23, 2024
1 parent edfd399 commit 9373798
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/map/map_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3614,13 +3614,13 @@ void map_template::load_0_ad_terrain_file()
const QXmlStreamReader::TokenType tokenType = xml_reader.readNext();

if (tokenType == QXmlStreamReader::StartElement) {
if (xml_reader.name() == "WaterBody") {
if (xml_reader.name() == QStringLiteral("WaterBody")) {
uint16_t water_height = 0;

const int water_height_multiplier = defines::get()->get_0_ad_water_height_multiplier();

while (xml_reader.readNextStartElement()) {
if (xml_reader.name() == "Height") {
if (xml_reader.name() == QStringLiteral("Height")) {
water_height = static_cast<uint16_t>(xml_reader.readElementText().toDouble() * water_height_multiplier);
} else {
xml_reader.skipCurrentElement();
Expand Down Expand Up @@ -3650,23 +3650,23 @@ void map_template::load_0_ad_terrain_file()
}
}
}
} else if (xml_reader.name() == "Entity") {
} else if (xml_reader.name() == QStringLiteral("Entity")) {
std::string template_name;
int player = PlayerNumNeutral;
QPoint pos(-1, -1);

while (xml_reader.readNextStartElement()) {
if (xml_reader.name() == "Template") {
if (xml_reader.name() == QStringLiteral("Template")) {
template_name = xml_reader.readElementText().toStdString();
} else if (xml_reader.name() == "Player") {
} else if (xml_reader.name() == QStringLiteral("Player")) {
const int xml_player = xml_reader.readElementText().toInt();

if (xml_player == 0) {
player = PlayerNumNeutral;
} else {
player = xml_player - 1;
}
} else if (xml_reader.name() == "Position") {
} else if (xml_reader.name() == QStringLiteral("Position")) {
const QXmlStreamAttributes attributes = xml_reader.attributes();
const double xml_x = attributes.value("x").toDouble();
const double xml_y = attributes.value("z").toDouble();
Expand Down

0 comments on commit 9373798

Please sign in to comment.