Synchronized WDW express elevator
This commit is contained in:
parent
5ad1b60a9f
commit
2b75690a31
|
@ -1,10 +1,21 @@
|
|||
// express_elevator.c.inc
|
||||
|
||||
void bhv_wdw_express_elevator_loop(void) {
|
||||
if (!network_sync_object_initialized(o)) {
|
||||
network_init_object(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
network_init_object_field(o, &o->oAction);
|
||||
network_init_object_field(o, &o->oPrevAction);
|
||||
network_init_object_field(o, &o->oTimer);
|
||||
network_init_object_field(o, &o->oVelY);
|
||||
network_init_object_field(o, &o->oPosY);
|
||||
}
|
||||
|
||||
o->oVelY = 0.0f;
|
||||
if (o->oAction == 0) {
|
||||
if (cur_obj_is_mario_on_platform())
|
||||
if (cur_obj_is_any_player_on_platform()) {
|
||||
o->oAction++;
|
||||
network_send_object(o);
|
||||
}
|
||||
} else if (o->oAction == 1) {
|
||||
o->oVelY = -20.0f;
|
||||
o->oPosY += o->oVelY;
|
||||
|
@ -22,6 +33,6 @@ void bhv_wdw_express_elevator_loop(void) {
|
|||
o->oPosY = o->oHomeY;
|
||||
o->oAction++;
|
||||
}
|
||||
} else if (!cur_obj_is_mario_on_platform())
|
||||
} else if (!cur_obj_is_any_player_on_platform())
|
||||
o->oAction = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue