From 5fae32d9f9e519a5d803406834081ff09ca1c702 Mon Sep 17 00:00:00 2001 From: Warren Ulrich Date: Wed, 5 Jul 2023 02:46:26 -0700 Subject: [PATCH] ignore null named objects --- src/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2dc1036..cbcc5ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,24 +71,24 @@ bool Loop() { auto paint_objects = [&](const auto &objects, uint8_t r, uint8_t g, uint8_t b) { for (const auto &obj : objects) { + std::stringstream ss; const auto name = obj.GetName(); - if (name == "") + if (name == "" || name == "null") continue; + ss << name; + const auto tile = obj.GetTile(); if (!tile) continue; + ss << ": (" << tile.X << ", " << tile.Y << ", " << tile.Plane << ")"; + const auto w2s = Internal::TileToMainscreen(tile, 0, 0, 0); if (!w2s) continue; - + paint_object(obj, r, g, b, 255); - - std::stringstream ss; - ss << name; - ss << ": (" << tile.X << ", " << tile.Y << ", " << tile.Plane << ")"; - Paint::DrawString(ss.str(), w2s, 255, 255, 255, 255); } };