X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_skate.c;h=f8b41660955128441b76d9badc5284f7a6cb6d6c;hb=25bf60849a782d43d886ed182c0c85b87cf87ab9;hp=1ea632a7ce1d87c78a69b6ef850f134708178787;hpb=22f62f001f21d1b91fefd9fc495c122d9ddf205a;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_skate.c b/player_skate.c index 1ea632a..f8b4166 100644 --- a/player_skate.c +++ b/player_skate.c @@ -2524,10 +2524,11 @@ begin_collision:; skate_integrate(); vg_line_point( state->cog, 0.02f, VG__WHITE ); - ent_gate *gate = - world_intersect_gates(world, localplayer.rb.co, state->prev_pos ); + u32 id = world_intersect_gates( world, localplayer.rb.co, state->prev_pos ); + + if( id ){ + ent_gate *gate = mdl_arritm( &world->ent_gate, mdl_entity_id_id(id) ); - if( gate ){ m4x3_mulv( gate->transport, localplayer.rb.co, localplayer.rb.co ); m3x3_mulv( gate->transport, localplayer.rb.v, localplayer.rb.v ); m4x3_mulv( gate->transport, state->cog, state->cog ); @@ -2543,7 +2544,7 @@ begin_collision:; q_mul( transport_rotation, state->smoothed_rotation, state->smoothed_rotation ); rb_update_transform( &localplayer.rb ); - player__pass_gate( gate ); + player__pass_gate( id ); } /* FIXME: Rate limit */ @@ -3115,7 +3116,8 @@ static void player__skate_post_animate(void){ localplayer.cam_velocity_influence = 1.0f; v3f head = { 0.0f, 1.8f, 0.0f }; - m4x3_mulv( av->sk.final_mtx[ av->id_head ], head, state->head_position ); + m4x3_mulv( localplayer.final_mtx[ av->id_head ], + head, state->head_position ); m4x3_mulv( localplayer.rb.to_local, state->head_position, state->head_position ); }