Update StrategySystem.cpp

This commit is contained in:
xixu-me committed 2023-12-01 13:23:23 +08:00
1 parent 776cc4dc88
commit 60b8b91e7a
1 file changed
+4 -2
+4 -2
View File
@@ -2410,8 +2410,10 @@ void CStrategySystem::Goalie() {
int gx = ball.position.x >= 740 && (ball.position.y <= 313 || ball.position.y >= 505) || ball.position.x >= 940 ? 965 : 950;
int gy = int(((ball.position.y - ball.oldPosition.y) * 1.0 / (ball.position.x - ball.oldPosition.x) * 1.0) * gx + (ball.oldPosition.y - ((ball.position.y - ball.oldPosition.y) * 1.0 / (ball.position.x - ball.oldPosition.x) * 1.0) * ball.oldPosition.x) + 0.5);
// if (ball.position.x < ball.oldPosition.x)
if (Distance(ball.position, ball.oldPosition) >= 5) {
if (ball.position.x >= 740 && (ball.position.y <= 313 && ball.position.y <= ball.oldPosition.y || ball.position.y >= 505 && ball.position.y >= ball.oldPosition.y) && ball.position.x <= ball.oldPosition.x) {
Direction(HGOALIE, CPoint(gx, 409));
}
else if (Distance(ball.position, ball.oldPosition) >= 5) {
if (gy < 313)
Direction(HGOALIE, CPoint(gx, 313));
else if (gy > 505)