From aaa4bd05f698a879691a266be073cbaf362d3a10 Mon Sep 17 00:00:00 2001 From: kernaltrap Date: Tue, 27 May 2025 19:02:29 -0500 Subject: [PATCH] Fix crash in `LegoAnimationManager::FUN_100609f0` I've come across an issue where the game will crash when you try to play two animations at once. Making a PR here since I don't think this happens on win32, however I can't test because I'm on Linux and Wine doesn't really like Lego Island. Hopefully this is the "correct" fix, I haven't had crashing after applying the fix. Signed-off-by: kernaltrap --- LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 960bc2b3..400940ed 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -1081,7 +1081,9 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix char buf[256]; sprintf(buf, "%s:%d", g_strANIMMAN_ID, info->m_index); - action.SetAtomId(*Lego()->GetWorldAtom(m_worldId)); + if (m_worldId != LegoOmni::e_undefined) { + action.SetAtomId(*Lego()->GetWorldAtom(m_worldId)); + } action.SetObjectId(p_objectId); action.SetUnknown24(-1); action.AppendExtra(strlen(buf) + 1, buf);