From 8e572f9b9b24f54324c9a166ea8d5ac32d8ad830 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 2 Oct 2020 23:33:07 -0700 Subject: [PATCH] Synchronized Sushi --- src/game/behaviors/sushi.inc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/sushi.inc.c b/src/game/behaviors/sushi.inc.c index 52282c64..3a9e06f4 100644 --- a/src/game/behaviors/sushi.inc.c +++ b/src/game/behaviors/sushi.inc.c @@ -4,13 +4,20 @@ void bhv_sushi_shark_collision_loop(void) { } void bhv_sushi_shark_loop(void) { + if (!network_sync_object_initialized(o)) { + network_init_object(o, 4000.0f); + network_init_object_field(o, &o->oSushiSharkUnkF4); + } + + struct Object* player = nearest_player_to_object(o); + f32 sp1C = find_water_level(o->oPosX, o->oPosZ); o->oPosX = o->oHomeX + sins(o->oSushiSharkUnkF4) * 1700.0f; o->oPosZ = o->oHomeZ + coss(o->oSushiSharkUnkF4) * 1700.0f; o->oPosY = sp1C + o->oHomeY + sins(o->oSushiSharkUnkF4) * 200.0f; o->oMoveAngleYaw = o->oSushiSharkUnkF4 + 0x4000; o->oSushiSharkUnkF4 += 0x80; - if (gMarioObject->oPosY - sp1C > -500.0f) + if (player->oPosY - sp1C > -500.0f) if (o->oPosY - sp1C > -200.0f) spawn_object_with_scale(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail, 4.0f); if ((o->oTimer & 0xF) == 0)