From 08b5739369700fba64e9f6ced0d946e931dabccf Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Mon, 14 Feb 2022 01:52:50 +0100 Subject: [PATCH] fix: always run HandleRemoveNodes, even if DTR element doesn't exist --- Dalamud/Game/Gui/Dtr/DtrBar.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dalamud/Game/Gui/Dtr/DtrBar.cs b/Dalamud/Game/Gui/Dtr/DtrBar.cs index 9fcf0de6e..fce98c8d0 100644 --- a/Dalamud/Game/Gui/Dtr/DtrBar.cs +++ b/Dalamud/Game/Gui/Dtr/DtrBar.cs @@ -133,11 +133,11 @@ namespace Dalamud.Game.Gui.Dtr private void Update(Framework unused) { + this.HandleRemovedNodes(); + var dtr = GetDtr(); if (dtr == null) return; - this.HandleRemovedNodes(); - // The collision node on the DTR element is always the width of its content if (dtr->UldManager.NodeList == null) return; @@ -236,7 +236,7 @@ namespace Dalamud.Game.Gui.Dtr private bool AddNode(AtkTextNode* node) { var dtr = GetDtr(); - if (dtr == null || dtr->RootNode == null || node == null) return false; + if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return false; var lastChild = dtr->RootNode->ChildNode; while (lastChild->PrevSiblingNode != null) lastChild = lastChild->PrevSiblingNode; @@ -256,7 +256,7 @@ namespace Dalamud.Game.Gui.Dtr private bool RemoveNode(AtkTextNode* node) { var dtr = GetDtr(); - if (dtr == null || dtr->RootNode == null || node == null) return false; + if (dtr == null || dtr->RootNode == null || dtr->UldManager.NodeList == null || node == null) return false; var tmpPrevNode = node->AtkResNode.PrevSiblingNode; var tmpNextNode = node->AtkResNode.NextSiblingNode;