From b03a9d118638b83e75b45e3b731f93ec9a3d5ed0 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Sat, 18 Jan 2025 02:43:08 -0300 Subject: [PATCH] fix: using enum on getWorldLocationByKey --- src/game/worlds/gameworlds.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/game/worlds/gameworlds.cpp b/src/game/worlds/gameworlds.cpp index 3d2f7801625..eba9dfea72a 100644 --- a/src/game/worlds/gameworlds.cpp +++ b/src/game/worlds/gameworlds.cpp @@ -65,19 +65,21 @@ const std::shared_ptr &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; }