diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 88b1836167..d880b1fb89 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -341,11 +341,14 @@ EntityBase* CreateEntity(EntityType type) if (EntityTypeIsMiscEntity(type)) { - // Misc sprites are commonly used for effects, if there are less than MAX_MISC_SPRITES - // free it will fail to keep slots for more relevant sprites. - // Also there can't be more than MAX_MISC_SPRITES sprites in this list. - uint16_t miscSlotsRemaining = MAX_MISC_SPRITES - GetMiscEntityCount(); - if (miscSlotsRemaining >= _freeIdList.size()) + // Misc sprites are commonly used for effects, give other entity types higher priority. + if (GetMiscEntityCount() >= MAX_MISC_SPRITES) + { + return nullptr; + } + + // If there are less than MAX_MISC_SPRITES free slots, ensure other entities can be created. + if (_freeIdList.size() < MAX_MISC_SPRITES) { return nullptr; }