From e99ca8cfce6265471964490b93b9bc0bc0c7025b Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 30 Jul 2020 23:17:18 -0700 Subject: [PATCH] Made bird Luigi-aware --- src/game/behaviors/bird.inc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/bird.inc.c b/src/game/behaviors/bird.inc.c index e6d081a4..95f1322d 100644 --- a/src/game/behaviors/bird.inc.c +++ b/src/game/behaviors/bird.inc.c @@ -15,7 +15,8 @@ static void bird_act_inactive(void) { // Start flying if the object is a spawned bird or if it's a spawner bird // and Mario is within 2000 units. - if (o->oBehParams2ndByte == BIRD_BP_SPAWNED || o->oDistanceToMario < 2000.0f) { + struct Object* player = nearest_player_object(o->oPosX, o->oPosY, o->oPosZ); + if (o->oBehParams2ndByte == BIRD_BP_SPAWNED || dist_between_objects(o, player) < 2000.0f) { // If the object is a spawner bird, play the sound of birds flying away, // and spawn 6 spawned birds (which will start flying on the next frame). if (o->oBehParams2ndByte != BIRD_BP_SPAWNED) {