Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/client/StarClientApplication.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-07-22 17:37:47 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-07-22 17:37:47 +1000
commit1a2f143f88c2991f5cec1685e354f25ca7917526 (patch)
tree58019827bb3103e8c5f76932342c0950a132ff30 /source/client/StarClientApplication.cpp
parent30dd83aa026b7077220f923b88ac33dac6e9b035 (diff)
debug: tile_dungeon_id is red if dungeon ID is protected
Diffstat (limited to 'source/client/StarClientApplication.cpp')
-rw-r--r--source/client/StarClientApplication.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index 5e317cf..460c17b 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -942,9 +942,10 @@ void ClientApplication::updateRunning(float dt) {
LogMap::set("player_pos", strf("[ ^#f45;{:4.2f}^reset;, ^#49f;{:4.2f}^reset; ]", m_player->position()[0], m_player->position()[1]));
LogMap::set("player_vel", strf("[ ^#f45;{:4.2f}^reset;, ^#49f;{:4.2f}^reset; ]", m_player->velocity()[0], m_player->velocity()[1]));
LogMap::set("player_aim", strf("[ ^#f45;{:4.2f}^reset;, ^#49f;{:4.2f}^reset; ]", aimPosition[0], aimPosition[1]));
- if (m_universeClient->worldClient()) {
- LogMap::set("tile_liquid_level", toString(m_universeClient->worldClient()->liquidLevel(Vec2I::floor(aimPosition)).level));
- LogMap::set("tile_dungeon_id", toString(m_universeClient->worldClient()->dungeonId(Vec2I::floor(aimPosition))));
+ if (auto world = m_universeClient->worldClient()) {
+ auto aim = Vec2I::floor(aimPosition);
+ LogMap::set("tile_liquid_level", toString(world->liquidLevel(aim).level));
+ LogMap::set("tile_dungeon_id", world->isTileProtected(aim) ? strf("^red;{}", world->dungeonId(aim)) : toString(world->dungeonId(aim)));
}
if (m_mainInterface->currentState() == MainInterface::ReturnToTitle)