From 5fa590f62aa7e62a8b6b07e10556c2ecc54cdca6 Mon Sep 17 00:00:00 2001 From: hgn Date: Fri, 29 Mar 2024 15:16:36 +0000 Subject: [PATCH] fix water splash sound --- player_walk.c | 4 +++- player_walk.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/player_walk.c b/player_walk.c index 843a50e..62aff8d 100644 --- a/player_walk.c +++ b/player_walk.c @@ -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), @@ -1192,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 ){ diff --git a/player_walk.h b/player_walk.h index b121354..da4172c 100644 --- a/player_walk.h +++ b/player_walk.h @@ -87,7 +87,8 @@ static f32 k_sit_yaw_limit = VG_PIf/1.7f, k_sit_pitch_limit = VG_PIf/4.0f; -static void player__walk_register(void){ +static void player__walk_register(void) +{ VG_VAR_F32( k_walkspeed, flags=VG_VAR_CHEAT ); VG_VAR_F32( k_runspeed, flags=VG_VAR_CHEAT ); VG_VAR_F32( k_stopspeed, flags=VG_VAR_CHEAT ); @@ -109,3 +110,4 @@ void player__walk_reset (void); void player__walk_restore (void); void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ); void player__walk_transition( bool grounded, f32 board_yaw ); +void player__walk_sfx_oneshot( u8 id, v3f pos, f32 volume ); -- 2.25.1