}
}
- teleport_gate *gate;
- if( (gate = world_intersect_gates(world, player->rb.co, w->state.prev_pos)) )
+ struct gate_hit hit;
+ if( world_intersect_gates(world, player->rb.co, w->state.prev_pos, &hit) )
{
+ teleport_gate *gate = hit.gate;
m4x3_mulv( gate->transport, player->rb.co, player->rb.co );
m3x3_mulv( gate->transport, player->rb.v, player->rb.v );
rb_update_transform( &player->rb );
w->state_gate_storage = w->state;
- player__pass_gate( player, gate );
+ player__pass_gate( player, &hit );
}
}