Correctly loop. Add typedef for easter egg functions

This commit is contained in:
duncanspumpkin 2017-04-12 20:44:44 +01:00
parent 1b98c0b1cb
commit 9257645cb7
1 changed files with 6 additions and 2 deletions

View File

@ -11122,7 +11122,9 @@ static bool peep_has_valid_xy(rct_peep *peep)
return false;
}
static void peep_apply_easter_egg_to_nearby_guests(rct_peep *peep, void(*easter_egg_function)(rct_peep* peep, rct_peep* otherPeep))
typedef void(*easter_egg_function)(rct_peep* peep, rct_peep* otherPeep);
static void peep_apply_easter_egg_to_nearby_guests(rct_peep *peep, easter_egg_function easter_egg)
{
if (!peep_has_valid_xy(peep))
return;
@ -11133,6 +11135,8 @@ static void peep_apply_easter_egg_to_nearby_guests(rct_peep *peep, void(*easter_
rct_peep * otherPeep = GET_PEEP(spriteIndex);
for (; spriteIndex != SPRITE_INDEX_NULL; spriteIndex = otherPeep->next_in_quadrant) {
otherPeep = GET_PEEP(spriteIndex);
if (otherPeep->sprite_identifier != SPRITE_IDENTIFIER_PEEP)
continue;
@ -11143,7 +11147,7 @@ static void peep_apply_easter_egg_to_nearby_guests(rct_peep *peep, void(*easter_
if (zDiff > 32)
continue;
easter_egg_function(peep, otherPeep);
easter_egg(peep, otherPeep);
}
}