Fix LegoPlantManager::CreatePlant

This commit is contained in:
Christian Semmler 2025-06-24 15:16:37 -07:00
parent 87b4c0412e
commit 54db195100
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C

View File

@ -214,7 +214,7 @@ LegoEntity* LegoPlantManager::CreatePlant(MxS32 p_index, LegoWorld* p_world, Leg
{ {
LegoEntity* entity = NULL; LegoEntity* entity = NULL;
if (p_index < sizeOfArray(g_plantInfo)) { if (p_worldId != LegoOmni::e_undefined && p_index < sizeOfArray(g_plantInfo)) {
MxU32 world = 1 << (MxU8) p_worldId; MxU32 world = 1 << (MxU8) p_worldId;
if (g_plantInfo[p_index].m_worlds & world && g_plantInfo[p_index].m_counter != 0) { if (g_plantInfo[p_index].m_worlds & world && g_plantInfo[p_index].m_counter != 0) {