fp: Fix the attack box path finding and hit detection

This commit is contained in:
2023-10-08 17:07:20 +11:00
parent efec333b61
commit ecfe730744
3 changed files with 9 additions and 20 deletions
+3 -1
View File
@@ -741,7 +741,9 @@ static Dqn_V2 FP_Game_CalcWaypointWorldPos(FP_Game *game, FP_GameEntityHandle sr
}
}
Dqn_f32 curr_dist_to_entity = Dqn_V2_LengthSq_V2x2(entity_rect.pos, src_rect.pos);
Dqn_V2 entity_pos = FP_Game_CalcEntityWorldPos(game, waypoint_entity->handle);
Dqn_V2 src_pos = FP_Game_CalcEntityWorldPos(game, src_entity);
Dqn_f32 curr_dist_to_entity = Dqn_V2_LengthSq_V2x2(entity_pos, src_pos);
if (curr_dist_to_entity < best_dist) {
// NOTE: We are already closer to the entity than the closest calculated side,
// we assume we're at the entity already.