From 39a30093d7af66315963d947f3b9a09d7ec77a7f Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 24 Sep 2020 00:06:14 -0700 Subject: [PATCH] Synchronized pyramid walls --- src/game/behaviors/pyramid_wall.inc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/pyramid_wall.inc.c b/src/game/behaviors/pyramid_wall.inc.c index 4e805f8d..ab640eeb 100644 --- a/src/game/behaviors/pyramid_wall.inc.c +++ b/src/game/behaviors/pyramid_wall.inc.c @@ -26,6 +26,12 @@ void bhv_ssl_moving_pyramid_wall_init(void) { o->oAction = PYRAMID_WALL_ACT_MOVING_UP; break; } + network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS); + network_init_object_field(o, &o->oPrevAction); + network_init_object_field(o, &o->oAction); + network_init_object_field(o, &o->oTimer); + network_init_object_field(o, &o->oVelY); + network_init_object_field(o, &o->oPosY); } /** @@ -36,8 +42,12 @@ void bhv_ssl_moving_pyramid_wall_loop(void) { switch (o->oAction) { case PYRAMID_WALL_ACT_MOVING_DOWN: o->oVelY = -5.12f; - if (o->oTimer == 100) + if (o->oTimer == 100) { o->oAction = PYRAMID_WALL_ACT_MOVING_UP; + if (network_owns_object(o)) { + network_send_object(o); + } + } break; case PYRAMID_WALL_ACT_MOVING_UP: