diff --git a/Source/UI/Window/UIWindow.cpp b/Source/UI/Window/UIWindow.cpp index 080c6aea0..532b19933 100644 --- a/Source/UI/Window/UIWindow.cpp +++ b/Source/UI/Window/UIWindow.cpp @@ -838,18 +838,6 @@ void UIWindow::ClearChildren(bool destroy) { } } -// OFFSET: 0x00AA5E90 -// FUNCTION: fn_17226 -void UIWindowMgr::DeferDeletion(UIWindow* window) { - if (!window) { - return; - } - - this->ForgetWindowReferences(window); - this->deferredDeletion.insert(window); - window->Show(0); -} - // OFFSET: 0x00A82E50 // FUNCTION: fn_16997 void UIWindow::RemoveChild(UIWindow* child, unsigned char destroy) { diff --git a/Source/UI/Window/WindowAncestry.cpp b/Source/UI/Window/WindowAncestry.cpp index ae3ec80cf..403e470b9 100644 --- a/Source/UI/Window/WindowAncestry.cpp +++ b/Source/UI/Window/WindowAncestry.cpp @@ -5,7 +5,7 @@ // OFFSET: 0x00A81C90 // FUNCTION: fn_16985 -bool UIWindow::IsDescendantOf(const UIWindow* ancestor) const { +__declspec(noinline) bool UIWindow::IsDescendantOf(const UIWindow* ancestor) const { for (const UIWindow* node = this->parent; node; node = node->parent) { if (node == ancestor) { return true; @@ -17,7 +17,7 @@ bool UIWindow::IsDescendantOf(const UIWindow* ancestor) const { // OFFSET: 0x00A8C200 // FUNCTION: fn_17130 -void UIWindowMgr::ForgetWindowReferences(UIWindow* removed) { +__forceinline void UIWindowMgr::ForgetWindowReferences(UIWindow* removed) { if (this->inputWindow && (this->inputWindow == removed || this->inputWindow->IsDescendantOf(removed))) { this->inputWindow = nullptr; } @@ -39,6 +39,18 @@ void UIWindowMgr::ForgetWindowReferences(UIWindow* removed) { } } +// OFFSET: 0x00AA5E90 +// FUNCTION: fn_17226 +void UIWindowMgr::DeferDeletion(UIWindow* window) { + if (!window) { + return; + } + + this->ForgetWindowReferences(window); + this->deferredDeletion.insert(window); + window->Show(0); +} + // OFFSET: 0x00AA8F30 // FUNCTION: fn_17250 void UIWindowMgr::ClearWindow01B8() {