map binary data
[carveJwlIkooP6JGAAIwe30JlM.git] / player_skate.c
index 11ff6ae8348e88bfda5862532b2905de5bf84344..eb12d641c9ad644bd19e805ad0008a3252b0ad34 100644 (file)
@@ -14,6 +14,7 @@
 #include "player_glide.h"
 #include "player_dead.h"
 #include "player_walk.h"
+#include <string.h>
 
 struct player_skate player_skate;
 struct player_subsystem_interface player_subsystem_skate = 
@@ -2229,20 +2230,10 @@ void player__skate_update(void){
    struct player_skate_state *state = &player_skate.state;
    world_instance *world = world_current_instance();
 
-   if( state->activity == k_skate_activity_handplant ){
+   if( state->activity == k_skate_activity_handplant )
       return;
-   }
 
-   if( world->water.enabled ){
-      if( localplayer.rb.co[1]+0.25f < world->water.height ){
-         vg_info( "player fell off due to being in water\n" );
-         player__networked_sfx( k_player_subsystem_walk, 32, 
-                                k_player_walk_soundeffect_splash,
-                                localplayer.rb.co, 1.0f );
-         player__dead_transition( k_player_die_type_generic );
-         return;
-      }
-   }
+   if( !world_water_player_safe( world, 0.25f ) ) return;
 
    v3_copy( localplayer.rb.co, state->prev_pos );
    state->activity_prev = state->activity;
@@ -3551,7 +3542,8 @@ void player__skate_reset_animator(void){
       player_skate.animator.fly = 0.0f;
 }
 
-void player__skate_clear_mechanics(void){
+void player__skate_clear_mechanics(void)
+{
    struct player_skate_state *state = &player_skate.state;
    state->jump_charge    = 0.0f;
    state->charging_jump  = 0;
@@ -3586,6 +3578,9 @@ void player__skate_clear_mechanics(void){
    v3_copy( localplayer.rb.to_world[1], player_skate.surface_picture );
    v3_copy( localplayer.rb.co, state->prev_pos );
    v3_zero( player_skate.weight_distribution );
+
+   v3f head = { 0.0f, 1.8f, 0.0f };
+   m4x3_mulv( localplayer.rb.to_world, head, state->head_position );
 }
 
 #include "network_compression.h"