From 099157e3bc282f553ce360a298f0720766f9a2be Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Wed, 16 Nov 2022 17:29:00 -0800 Subject: [PATCH] Set player velocity to medbay velocity on exit --- gamestate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gamestate.c b/gamestate.c index 3109d67..9d4d70b 100644 --- a/gamestate.c +++ b/gamestate.c @@ -1519,11 +1519,12 @@ EntityID create_spacestation(GameState *gs) return get_id(gs, grid); } -void exit_seat(GameState *gs, Entity *seat_in, Entity *player) +void exit_seat(GameState *gs, Entity *seat_in, Entity *p) { V2 pilot_seat_exit_spot = V2add(entity_pos(seat_in), V2scale(box_facing_vector(seat_in), BOX_SIZE)); - cpBodySetPosition(player->body, v2_to_cp(pilot_seat_exit_spot)); - cpBodySetVelocity(player->body, v2_to_cp(player_vel(gs, player))); + cpBodySetPosition(p->body, v2_to_cp(pilot_seat_exit_spot)); + //cpBodySetVelocity(p->body, v2_to_cp(player_vel(gs, p))); + cpBodySetVelocity(p->body, cpBodyGetVelocity(box_grid(seat_in)->body)); } void process_fixed_timestep(GameState *gs)