Skip to content

Commit

Permalink
fix: using enum on getWorldLocationByKey
Browse files Browse the repository at this point in the history
  • Loading branch information
phacUFPE committed Jan 18, 2025
1 parent ce9d52b commit b03a9d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/game/worlds/gameworlds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@ const std::shared_ptr<World> &Worlds::getCurrentWorld() const {
}

[[nodiscard]] Location_t Worlds::getWorldLocationByKey(const std::string &key) {
using enum Location_t;

const std::string location = asLowerCaseString(key);

if (location == "europe") {
return Location_t::Europe;
return Europe;
} else if (location == "north america") {
return Location_t::NorthAmerica;
return NorthAmerica;
} else if (location == "south america") {
return Location_t::SouthAmerica;
return SouthAmerica;
} else if (location == "oceania") {
return Location_t::Oceania;
return Oceania;
}

g_logger().error("[{}] - Unable to get world location from string '{}'", __FUNCTION__, location);

return Location_t::None;
return None;
}

0 comments on commit b03a9d1

Please sign in to comment.