From 18e6c2e767720c35faf0743cbcac0a94279e1768 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 18:45:28 -0700 Subject: [PATCH] Fix game object sign orientation and restrict nameplates to target only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Game object M2 models share the same default facing (+renderX) as character models, so apply the same π/2 offset instead of π when computing renderYawM2go from canonical yaw. This corrects street signs and hanging shop signs that were 90° off after the server-yaw formula fix. Nameplates (health bar + name label) are now only rendered for the currently targeted entity, matching WoW's default UI behaviour and reducing visual noise. --- src/core/application.cpp | 4 +++- src/ui/game_screen.cpp | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/application.cpp b/src/core/application.cpp index e07b4130..be239cfc 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6698,7 +6698,9 @@ void Application::spawnOnlineGameObject(uint64_t guid, uint32_t entry, uint32_t glm::vec3 renderPos = core::coords::canonicalToRender(glm::vec3(x, y, z)); const float renderYawWmo = orientation; - const float renderYawM2go = orientation + glm::radians(180.0f); + // M2 game objects: model default faces +renderX. renderYaw = canonical + 90° = server_yaw + // (same offset as creature/character renderer so all M2 models face consistently) + const float renderYawM2go = orientation + glm::radians(90.0f); bool loadedAsWmo = false; if (isWmo) { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index fd637c40..06e6b4b5 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4718,6 +4718,9 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) { auto* unit = dynamic_cast(entityPtr.get()); if (!unit || unit->getMaxHealth() == 0) continue; + // Only show nameplate for the currently targeted unit + if (guid != targetGuid) continue; + // Convert canonical WoW position → render space, raise to head height glm::vec3 renderPos = core::coords::canonicalToRender( glm::vec3(unit->getX(), unit->getY(), unit->getZ()));