another emerald UB

This commit is contained in:
cawtds
2024-06-27 18:19:19 +02:00
parent 3af5d28ed1
commit 36af005cc4

View File

@@ -381,6 +381,13 @@ static u32 CountPlayersInGroupAndGetActivity(struct RfuPlayer * player, u32 * gr
for (i = 0; i < ARRAY_COUNT(sActivityGroupInfo); i++)
{
#ifdef UBFIX
// GROUPTYPE_NONE is 0xFF, and shouldn't be used as an index into groupCounts.
// In theory the only activity with this group type (ACTIVITY_SEARCH) wouldn't
// satisfy the condition below, but not necessarily.
if (group_type(i) == GROUPTYPE_NONE)
continue;
#endif
if (activity == group_activity(i) && player->groupScheduledAnim == UNION_ROOM_SPAWN_IN)
{
if (group_players(i) == 0)