From 077532a8d08bb7c8835856c77229109944ef0dca Mon Sep 17 00:00:00 2001 From: attick Date: Thu, 21 Nov 2019 19:00:00 -0500 Subject: [PATCH] Re-enable buff array searching. --- Dalamud/Game/Internal/Gui/IconReplacer.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dalamud/Game/Internal/Gui/IconReplacer.cs b/Dalamud/Game/Internal/Gui/IconReplacer.cs index 45c5f6a8e..4601862fb 100644 --- a/Dalamud/Game/Internal/Gui/IconReplacer.cs +++ b/Dalamud/Game/Internal/Gui/IconReplacer.cs @@ -85,7 +85,15 @@ namespace Dalamud.Game.Internal.Gui { if (this.VanillaIDs.Contains(actionID)) return this.iconHook.Original(self, actionID); if (!this.CustomIDs.Contains(actionID)) return actionID; - + if (this.activeBuffArray == IntPtr.Zero) { + try { + this.activeBuffArray = FindBuffAddress(); + } + catch(Exception e) { //Before you're loaded in + this.activeBuffArray = IntPtr.Zero; + return this.iconHook.Original(self, actionID); + } + } // Don't clutter the spaghetti any worse than it already is. var lastMove = Marshal.ReadInt32(this.lastComboMove); var comboTime = Marshal.ReadInt32(this.comboTimer); @@ -826,11 +834,10 @@ namespace Dalamud.Game.Internal.Gui { return this.iconHook.Original(self, actionID); } - private bool SearchBuffArray(short needle) {/* + private bool SearchBuffArray(short needle) { for (int i = 0; i < 60; i++) { if (Marshal.ReadInt16(activeBuffArray + 4 * i) == needle) return true; - } - */ + } return false; }