From d63b811cb7c7d67ee9327492e0113397cb950475 Mon Sep 17 00:00:00 2001 From: Joseph Ameer Aziz Date: Thu, 13 Aug 2026 07:28:54 +0300 Subject: [PATCH] tweak(Controlbar): Allow observer to view contained units if not following player --- .../GameClient/GUI/ControlBar/ControlBar.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp index 697ee47a0a4..f3a8a920fc2 100644 --- a/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp @@ -1479,6 +1479,22 @@ void ControlBar::update() exitPosition = obj->getObjectExitInterface()->getRallyPoint(); showRallyPoint(exitPosition); + + ContainModuleInterface* observerContain = obj ? obj->getContain() : nullptr; + Bool showObserverInventory = (observerContain != nullptr && observerContain->getContainMax() > 0); + + if (showObserverInventory && m_observerLookAtPlayer == nullptr) + { + if (m_currContext != CB_CONTEXT_STRUCTURE_INVENTORY || m_currentSelectedDrawable != drawToEvaluateFor) + switchToContext(CB_CONTEXT_STRUCTURE_INVENTORY, drawToEvaluateFor); + else + updateContextStructureInventory(); + } + else if (m_currContext != CB_CONTEXT_OBSERVER_LIST) + { + switchToContext(CB_CONTEXT_OBSERVER_LIST, nullptr); + } + return; }