From c904f9d4f1055330f437845ee5a323a9646e8686 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Tue, 18 Jul 2023 16:05:14 -0300 Subject: TObject: Properly match `run_tasks()` I thought of doing this because of this message from Ninji. https://discord.com/channels/727908905392275526/727908905828483073/1130913392635432972 --- src/pso/TObject.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/pso/TObject.cpp b/src/pso/TObject.cpp index c832ebe..b0c288d 100644 --- a/src/pso/TObject.cpp +++ b/src/pso/TObject.cpp @@ -117,14 +117,13 @@ void TObject::render_nodes() { } } -// Perfect match, needed to do some weird stuff to get it to match, see below. void TObject::run_tasks() { TObject *child = this->m_down; while (this->m_down != NULL && child != NULL) { TObject *node = child; child = child->m_next; if (node->m_flags & DISALLOW_UPDATE) { - // Clearing flag 0 in the if statement is required to match. + // NOTE: Clearing flag 0 in the if statement is required to match. if (node->m_flags & QUEUE_DESTRUCTION && (node->m_flags &= ~QUEUE_DESTRUCTION, !(node->m_flags & DISALLOW_DESTRUCTION))) { delete node; } else { @@ -134,11 +133,13 @@ void TObject::run_tasks() { node->m_flags &= ~CHILD_QUEUE_DESTRUCTION; } - if (!(node->m_flags & BIT_2)) { - // Adding this here somehow causes the - // dead code to be compiled. - // `volatile` typecast is required to match. - (vu16)node->m_flags & QUEUE_DESTRUCTION; + // NOTE: Both if statements below are required to match. + if (node->m_flags & BIT_2) { + continue; + } + + if (node->m_flags & BIT_3) { + continue; } } } else { -- cgit v1.2.3-13-gbd6f