port
[carveJwlIkooP6JGAAIwe30JlM.git] / player_walk.c
index 99dee8ee7186d27fd9927a02244da3ec61b17603..952db860a638b5d0218d2c7da0f6a392a34f9eb4 100644 (file)
@@ -791,10 +791,10 @@ static void player__walk_animate(void){
    {
       f32 head_yaw = localplayer.angles[0] + VG_PIf,
           y = vg_angle_diff( head_yaw, -walk_yaw ),
-          mp = VG_PIf / 4.0f,
-          p = vg_clampf( localplayer.angles[1], -mp, mp );
+          p = vg_clampf( localplayer.angles[1], 
+                           -k_sit_pitch_limit, k_sit_pitch_limit );
 
-      if( fabsf(y) > VG_PIf/1.7f ){
+      if( fabsf(y) > k_sit_yaw_limit ){
          y = 0.0f;
          p = 0.0f;
       }
@@ -1044,12 +1044,18 @@ static void player__walk_animator_exchange( bitpack_ctx *ctx, void *data ){
    bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->run );
    bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->walk );
    bitpack_qf32( ctx, 16, 0.0f, 120.0f, &animator->walk_timer );
-
-   bitpack_bytes( ctx, 8, &animator->outro_type );
-   if( animator->outro_type ){
-      bitpack_bytes(ctx, sizeof(animator->foot_anchor), animator->foot_anchor );
-      bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t );
-      bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t );
+   bitpack_qf32( ctx, 8, -k_sit_yaw_limit, k_sit_yaw_limit, &animator->yaw );
+   bitpack_qf32( ctx, 8, -k_sit_pitch_limit, k_sit_pitch_limit, 
+                  &animator->pitch );
+
+   for( int i=0; i<1; i++ ){ /* without this you get a warning from gcc. lol */
+      bitpack_bytes( ctx, 8, &animator->outro_type );
+      if( animator->outro_type ){
+         bitpack_bytes( ctx, sizeof(animator->foot_anchor), 
+                        animator->foot_anchor );
+         bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->outro_t );
+         bitpack_qf32( ctx, 8, 0.0f, 1.0f, &animator->commit_t );
+      }
    }
 }
 #endif /* PLAYER_DEVICE_WALK_H */