projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix null reference
[carveJwlIkooP6JGAAIwe30JlM.git]
/
player_walk.c
diff --git
a/player_walk.c
b/player_walk.c
index e269166630dfd85c0eb909fbdc8b34e3c7902867..717411c88476cdd7bd56f74f060e186c22cd005a 100644
(file)
--- 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 ){
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;
}
player__dead_transition();
return;
}
@@
-1035,6
+1037,13
@@
static void player__walk_reset(void){
w->state.activity = k_walk_activity_air;
w->state.outro_type = k_walk_outro_none;
w->state.outro_start_time = 0.0;
w->state.activity = k_walk_activity_air;
w->state.outro_type = k_walk_outro_none;
w->state.outro_start_time = 0.0;
+
+ v3f fwd = { 0.0f, 0.0f, 1.0f };
+ q_mulv( localplayer.rb.q, fwd, fwd );
+ q_axis_angle( localplayer.rb.q, (v3f){0.0f,1.0f,0.0f},
+ atan2f(fwd[0], fwd[2]) );
+
+ rb_update_transform( &localplayer.rb );
}
static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
}
static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
@@
-1064,4
+1073,14
@@
static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
&animator->pitch );
}
}
&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 */
#endif /* PLAYER_DEVICE_WALK_H */