From 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:23:44 +1000 Subject: The Formatting String Catastrophe --- source/game/StarBiomeDatabase.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/game/StarBiomeDatabase.cpp') diff --git a/source/game/StarBiomeDatabase.cpp b/source/game/StarBiomeDatabase.cpp index d797a56..9a39781 100644 --- a/source/game/StarBiomeDatabase.cpp +++ b/source/game/StarBiomeDatabase.cpp @@ -24,7 +24,7 @@ BiomeDatabase::BiomeDatabase() { auto name = parameters.getString("name"); if (map.contains(name)) - throw BiomeException(strf("Duplicate %s generator name '%s'", type, name)); + throw BiomeException(strf("Duplicate {} generator name '{}'", type, name)); map[name] = {path, name, parameters}; } }; @@ -125,20 +125,20 @@ StringList BiomeDatabase::weatherNames() const { WeatherType BiomeDatabase::weatherType(String const& name) const { if (!m_weathers.contains(name)) - throw BiomeException(strf("No such weather type '%s'", name)); + throw BiomeException(strf("No such weather type '{}'", name)); auto config = m_weathers.get(name); try { return WeatherType(config.parameters, config.path); } catch (MapException const& e) { - throw BiomeException(strf("Required key not found in weather config %s", config.path), e); + throw BiomeException(strf("Required key not found in weather config {}", config.path), e); } } BiomePtr BiomeDatabase::createBiome(String const& biomeName, uint64_t seed, float verticalMidPoint, float threatLevel) const { if (!m_biomes.contains(biomeName)) - throw BiomeException(strf("No such biome '%s'", biomeName)); + throw BiomeException(strf("No such biome '{}'", biomeName)); auto& root = Root::singleton(); auto materialDatabase = root.materialDatabase(); @@ -183,7 +183,7 @@ BiomePtr BiomeDatabase::createBiome(String const& biomeName, uint64_t seed, floa return biome; } catch (std::exception const& cause) { - throw BiomeException(strf("Failed to parse biome: '%s'", biomeName), cause); + throw BiomeException(strf("Failed to parse biome: '{}'", biomeName), cause); } } -- cgit v1.2.3