X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=player_walk.c;h=12d070609153c20fbad6d62abc34055457c85ef3;hb=c0e4a67ba2f001179df6e2cde97370a946669c22;hp=e269166630dfd85c0eb909fbdc8b34e3c7902867;hpb=874c9d7e6ee2d826f9eb34518e8163283439c38e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_walk.c b/player_walk.c index e269166..12d0706 100644 --- a/player_walk.c +++ b/player_walk.c @@ -432,7 +432,9 @@ static void player__walk_update(void){ if( world->water.enabled ){ if( localplayer.rb.co[1]+0.4f < world->water.height ){ - audio_oneshot_3d( &audio_splash, localplayer.rb.co, 40.0f, 1.0f ); + player__networked_sfx( k_player_subsystem_walk, 32, + k_player_walk_soundeffect_splash, + localplayer.rb.co, 1.0f ); player__dead_transition(); return; } @@ -1064,4 +1066,14 @@ static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){ &animator->pitch ); } } + +static void player__walk_sfx_oneshot( u8 id, v3f pos, f32 volume ){ + audio_lock(); + + if( id == k_player_walk_soundeffect_splash ){ + audio_oneshot_3d( &audio_splash, pos, 40.0f, 1.0f ); + } + + audio_unlock(); +} #endif /* PLAYER_DEVICE_WALK_H */