X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player.c;h=0e45e996ca62efedbef1fc97d30e999b7ffe71ec;hb=b270d9efa9bedb7ca0813acffc1632f84900c0de;hp=d248aec116445aa558842503ecb521c4cc950680;hpb=8b783ef3705f88f0f67ef6cd8113f79ccb25ec20;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player.c b/player.c index d248aec..0e45e99 100644 --- a/player.c +++ b/player.c @@ -7,6 +7,7 @@ #include "input.h" #include "world.h" #include "audio.h" +#include "player_replay.h" VG_STATIC int localplayer_cmd_respawn( int argc, const char *argv[] ) { @@ -163,14 +164,14 @@ void player__pass_gate( player_instance *player, ent_gate *gate ) m4x3_mulv( gate->transport, player->cam.pos, player->cam.pos ); - if( gate->type == k_gate_type_nonlocel ) + if( gate->flags & k_ent_gate_nonlocal ) world_static.active_world = gate->target; - world_volumes.inside = 0; - audio_lock(); audio_oneshot( &audio_gate_pass, 1.0f, 0.0f ); audio_unlock(); + + replay_clear( &skaterift.replay ); } VG_STATIC void player_apply_transport_to_cam( m4x3f transport ) @@ -224,6 +225,10 @@ PLAYER_API void player__im_gui( player_instance *player ){ g_player_debugger[2] = 300; g_player_debugger[3] = 32; + player__debugtext( 2, "world (%u)", world_static.active_world ); + player__debugtext( 1, "model version: %u", + world_current_instance()->meta.info.version ); + player__debugtext( 2, "director" ); player__debugtext( 1, "activity: %s", (const char *[]){ [k_skaterift_menu] = "menu", @@ -252,6 +257,7 @@ PLAYER_API void player__setpos( player_instance *player, v3f pos ){ } PLAYER_API void player__spawn( player_instance *player, ent_spawn *rp ){ + replay_clear( &skaterift.replay ); player__setpos( player, rp->transform.co ); v3_zero( player->rb.w ); q_identity( player->rb.q ); @@ -277,6 +283,11 @@ PLAYER_API void player__kill( player_instance *player ){ } +PLAYER_API void player__begin_holdout( player_instance *player ){ + memcpy( &player->holdout_pose, &player->pose, sizeof(player->pose) ); + player->holdout_time = 1.0f; +} + /* implementation */ #include "player_common.c" #include "player_walk.c"