Update StrategySystem.cpp

This commit is contained in:
xixu-me committed 2023-12-02 01:47:00 +08:00
1 parent edb4e6284e
commit 3bf0b302ad
1 file changed
+6 -2
+6 -2
View File
@@ -2410,7 +2410,7 @@ void CStrategySystem::Goalie() {
static int xit;
if (ball.position.x < hgoalie.position.x && Distance(ball.position, hgoalie.position) > 1) {
int xix = ball.position.x >= 730 && (ball.position.y <= 313 || ball.position.y >= 505) || ball.position.x >= 940 ? 965 : 950;
int xix = ball.position.x >= 873 && (ball.position.y <= 313 || ball.position.y >= 505) || ball.position.x >= 940 ? 965 : 950;
// int xix = ball.position.x >= 730 ? 965 : 950;
int xiy = 409;
@@ -2418,6 +2418,7 @@ void CStrategySystem::Goalie() {
xiy = int(((ball.position.y - ball.oldPosition.y) * 1.0 / (ball.position.x - ball.oldPosition.x) * 1.0) * (xix - 8) + (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 (Distance(ball.position, ball.oldPosition) < 1 || ball.position.x <= ball.oldPosition.x || xiy < 313 || xiy > 505) {
if (ball.position.x >= 863) {
if (ball.position.x >= 927) {
if (ball.position.y < 313)
@@ -2458,7 +2459,10 @@ void CStrategySystem::Goalie() {
xiy -= 30;
}
Direction(HGOALIE, CPoint(xix, xiy));
if (xiy < 303 || xiy > 507)
Position(HGOALIE, CPoint(xix, xiy));
else
Direction(HGOALIE, CPoint(xix, xiy));
}
else
Stop(HGOALIE);