From 1b3d1d5149fd35b233b6e09c08ce4c9c8445e75d Mon Sep 17 00:00:00 2001 From: patman <27874300+patmanf@users.noreply.github.com> Date: Thu, 16 Jan 2025 23:11:38 -0600 Subject: [PATCH] wait i forgot to commit this lol --- source/game/StarDungeonGenerator.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/game/StarDungeonGenerator.cpp b/source/game/StarDungeonGenerator.cpp index 179307e..7905fee 100644 --- a/source/game/StarDungeonGenerator.cpp +++ b/source/game/StarDungeonGenerator.cpp @@ -1429,27 +1429,28 @@ DungeonGenerator::DungeonGenerator(String const& dungeonName, uint64_t seed, flo } Maybe, Set>> DungeonGenerator::generate(DungeonGeneratorWorldFacadePtr facade, Vec2I position, bool markSurfaceAndTerrain, bool forcePlacement) { + String name = m_def->name(); try { Dungeon::DungeonGeneratorWriter writer(facade, markSurfaceAndTerrain ? position[1] : Maybe(), m_def->extendSurfaceFreeSpace()); - Logger::debug(forcePlacement ? "Forcing generation of dungeon {}" : "Generating dungeon {}", m_def->name()); + Logger::debug(forcePlacement ? "Forcing generation of dungeon {}" : "Generating dungeon {}", name); Dungeon::PartConstPtr anchor = pickAnchor(); if (!anchor) { - Logger::error("No valid anchor piece found for dungeon at {}", position); + Logger::error("No valid anchor piece found for dungeon {} at {}", name, position); return {}; } auto pos = position + Vec2I(0, -anchor->placementLevelConstraint()); if (forcePlacement || anchor->canPlace(pos, &writer)) { - Logger::info("Placing dungeon {} at {}", m_def->name(), position); + Logger::info("Placing dungeon {} at {}", name, position); return buildDungeon(anchor, pos, &writer, forcePlacement); } else { - Logger::debug("Failed to place dungeon {} at {}", m_def->name(), position); + Logger::debug("Failed to place dungeon {} at {}", name, position); return {}; } } catch (std::exception const& e) { - throw DungeonException(strf("Error generating dungeon named '{}'", m_def->name()), e); + throw DungeonException(strf("Error generating dungeon named '{}'", name), e); } }