fp: Fix the attack box path finding and hit detection
This commit is contained in:
+3
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user