variable length exchange
[carveJwlIkooP6JGAAIwe30JlM.git] / player.c
index c478305a4d27a4ee974f467b583aff871e893623..78449ad1e04b2a80338948ccff385cccc4df7abb 100644 (file)
--- a/player.c
+++ b/player.c
@@ -114,9 +114,17 @@ static void player__post_update(void){
 /*
  * Applies gate transport to a player_interface
  */
-static void player__pass_gate( ent_gate *gate ){
-   world_routes_fracture( world_current_instance(), gate, 
-                          localplayer.rb.co, localplayer.rb.v );
+static void player__pass_gate( u32 id ){
+   world_instance *world = world_current_instance();
+
+   /* update boundary hash (network animation) */
+   u16 index = mdl_entity_id_id(id) & ~NETMSG_BOUNDARY_MASK;
+   localplayer.boundary_hash ^= NETMSG_GATE_BOUNDARY_BIT;
+   localplayer.boundary_hash &= ~NETMSG_BOUNDARY_MASK;
+   localplayer.boundary_hash |= index;
+
+   ent_gate *gate = mdl_arritm( &world->ent_gate, mdl_entity_id_id(id) );
+   world_routes_fracture( world, gate, localplayer.rb.co, localplayer.rb.v );
 
    localplayer.gate_waiting = gate;
    world_routes_activate_entry_gate( world_current_instance(), gate );
@@ -246,6 +254,8 @@ static void player__spawn( ent_spawn *rp ){
 
    if( player_subsystems[ localplayer.subsystem ]->reset )
       player_subsystems[ localplayer.subsystem ]->reset( rp );
+
+   localplayer.boundary_hash ^= NETMSG_BOUNDARY_BIT;
 }