fix RT textures compiler
[carveJwlIkooP6JGAAIwe30JlM.git] / player_walk.c
index b89263433b5a1522570d209e96a2840b6c41c10a..62aff8ddfe2af0635e61b254422a26d64308036f 100644 (file)
@@ -22,6 +22,7 @@ struct player_subsystem_interface player_subsystem_walk =
    .post_animate = player__walk_post_animate,
    .pose = player__walk_pose,
    .network_animator_exchange = player__walk_animator_exchange,
+   .sfx_oneshot = player__walk_sfx_oneshot,
 
    .animator_data = &player_walk.animator,
    .animator_size = sizeof(player_walk.animator),
@@ -468,17 +469,7 @@ static void player_walk_update_generic(void){
    v3_zero( localplayer.rb.w );
 
    world_instance *world = world_current_instance();
-
-   if( world->water.enabled ){
-      if( localplayer.rb.co[1]+0.4f < world->water.height ){
-         player__networked_sfx( k_player_subsystem_walk, 32, 
-                                k_player_walk_soundeffect_splash,
-                                localplayer.rb.co, 1.0f );
-         vg_info( "player fell of due to walking into walker\n" );
-         player__dead_transition( k_player_die_type_generic );
-         return;
-      }
-   }
+   if( !world_water_player_safe( world, 0.4f ) ) return;
 
    enum walk_activity prev_state = w->state.activity;
 
@@ -1202,7 +1193,8 @@ void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
    bitpack_qf32( ctx, 16, -100.0f, 100.0f, &animator->board_yaw );
 }
 
-void player__walk_sfx_oneshot( u8 id, v3f pos, f32 volume ){
+void player__walk_sfx_oneshot( u8 id, v3f pos, f32 volume )
+{
    audio_lock();
 
    if( id == k_player_walk_soundeffect_splash ){