diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/game/StarSystemWorldServer.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/game/StarSystemWorldServer.cpp')
-rw-r--r-- | source/game/StarSystemWorldServer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/game/StarSystemWorldServer.cpp b/source/game/StarSystemWorldServer.cpp index 3cffbc9..1f1dc66 100644 --- a/source/game/StarSystemWorldServer.cpp +++ b/source/game/StarSystemWorldServer.cpp @@ -148,10 +148,10 @@ List<InstanceWorldId> SystemWorldServer::activeInstanceWorlds() const { void SystemWorldServer::removeObject(Uuid objectUuid) { if (!m_objects.contains(objectUuid)) - throw StarException(strf("Cannot remove object with uuid '%s', object doesn't exist.", objectUuid.hex())); + throw StarException(strf("Cannot remove object with uuid '{}', object doesn't exist.", objectUuid.hex())); if (m_objects[objectUuid]->permanent()) - throw StarException(strf("Cannot remove object with uuid '%s', object is marked permanent", objectUuid.hex())); + throw StarException(strf("Cannot remove object with uuid '{}', object is marked permanent", objectUuid.hex())); // already removing it if (m_objectDestroyQueue.contains(objectUuid)) @@ -314,7 +314,7 @@ Json SystemWorldServer::diskStore() { void SystemWorldServer::placeInitialObjects() { auto config = Root::singleton().assets()->json("/systemworld.config"); - RandomSource rand(staticRandomU64("SystemWorldGeneration", strf("%s", m_location))); + RandomSource rand(staticRandomU64("SystemWorldGeneration", strf("{}", m_location))); WeightedPool<JsonArray> spawnPools = jsonToWeightedPool<JsonArray>(config.getArray("initialObjectPools")); JsonArray spawn = spawnPools.select(rand); @@ -429,7 +429,7 @@ SkyParameters SystemWorldServer::locationSkyParameters(SystemLocation const& loc if (auto visitableParameters = parameters->visitableParameters()) { if (is<TerrestrialWorldParameters>(visitableParameters)) { - uint64_t seed = staticRandomU64(strf("%s", m_location)); + uint64_t seed = staticRandomU64(strf("{}", m_location)); List<CelestialParameters> worlds; if (auto planet = m_celestialDatabase->parameters(orbitTarget)) worlds.append(*planet); |