From cb5dcaa4f45e6bfdf8da7354bb877671078e5d51 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 28 Aug 2020 20:26:17 -0700 Subject: [PATCH] Synchronized sliding platform 2 --- src/game/behaviors/sliding_platform_2.inc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/game/behaviors/sliding_platform_2.inc.c b/src/game/behaviors/sliding_platform_2.inc.c index fc0351ac..41f6f61a 100644 --- a/src/game/behaviors/sliding_platform_2.inc.c +++ b/src/game/behaviors/sliding_platform_2.inc.c @@ -34,6 +34,20 @@ void bhv_sliding_plat_2_init(void) { } void bhv_sliding_plat_2_loop(void) { + if (network_sync_object_initialized(o)) { + struct SyncObject* so = network_init_object(o, 1000.0f); + so->maxUpdateRate = 5.0f; + network_init_object_field(o, &o->oBackAndForthPlatformUnkFC); + network_init_object_field(o, &o->oBackAndForthPlatformUnk100); + network_init_object_field(o, &o->oPosX); + network_init_object_field(o, &o->oPosY); + network_init_object_field(o, &o->oPosZ); + network_init_object_field(o, &o->oVelX); + network_init_object_field(o, &o->oVelY); + network_init_object_field(o, &o->oVelZ); + network_init_object_field(o, &o->oTimer); + } + if (o->oTimer > 10) { o->oBackAndForthPlatformUnkFC += o->oBackAndForthPlatformUnk100; if (clamp_f32(&o->oBackAndForthPlatformUnkFC, -o->oBackAndForthPlatformUnkF8, 0.0f)) {