X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.c;h=78449ad1e04b2a80338948ccff385cccc4df7abb;hb=88f8273a9ab7b0644813625c43c70c5af34cd4f5;hp=1cd1bec67a2b323303cf9c798c2a45265a1a5ad4;hpb=22f62f001f21d1b91fefd9fc495c122d9ddf205a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.c b/player.c index 1cd1bec..78449ad 100644 --- a/player.c +++ b/player.c @@ -8,6 +8,7 @@ #include "world.h" #include "audio.h" #include "player_replay.h" +#include "network.h" static int localplayer_cmd_respawn( int argc, const char *argv[] ){ ent_spawn *rp = NULL, *r; @@ -113,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 ); @@ -163,23 +172,6 @@ static void player_apply_transport_to_cam( m4x3f transport ){ m4x4_mul( world_gates.cam.mtx.v, transport_4, world_gates.cam.mtx.v ); } -#if 0 -__attribute__ ((deprecated)) -static void gate_rotate_angles( ent_gate *gate, v3f angles, v3f d ) -{ - v3_copy( angles, d ); - return; - - v3f fwd_dir = { cosf(angles[0]), - 0.0f, - sinf(angles[0])}; - m3x3_mulv( gate->transport, fwd_dir, fwd_dir ); - - v3_copy( angles, d ); - d[0] = atan2f( fwd_dir[2], fwd_dir[0] ); -} -#endif - static void player__im_gui(void){ if( !k_player_debug_info ) return; @@ -262,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; }