From 0644633fb8ab2a680b2347fda0c72e96d7853101 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 10 Feb 2024 12:49:51 -0500 Subject: [PATCH] Fix/match --- LEGO1/lego/legoomni/src/common/legoutil.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/LEGO1/lego/legoomni/src/common/legoutil.cpp b/LEGO1/lego/legoomni/src/common/legoutil.cpp index f45d4832..0ac84ccd 100644 --- a/LEGO1/lego/legoomni/src/common/legoutil.cpp +++ b/LEGO1/lego/legoomni/src/common/legoutil.cpp @@ -135,17 +135,20 @@ void NotifyEntity(const char* p_filename, MxS32 p_entityId, LegoEntity* p_sender { MxAtomId atom(p_filename, e_lowerCase2); LegoEntity* entity = FindWorld(atom, p_entityId); + if (entity == NULL) { LegoWorldListCursor cursor(Lego()->GetWorldList()); LegoWorld* current; - while (entity == NULL) { - cursor.Next(current); + + while (cursor.Next(current)) { entity = (LegoEntity*) current->Find(atom, p_entityId); + + if (entity != NULL) + break; } } if (entity != NULL) { - #ifdef COMPAT_MODE { MxNotificationParam param(c_notificationType0, p_sender);