Update StrategySystem.cpp
This commit is contained in:
1 parent
c0a3c1a879
commit
0ba7b27322
1 file changed
+18
-2
+18
-2
@@ -2418,7 +2418,16 @@ 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) {
|
||||
xiy = int((Distance(ball.position, CPoint(863, 313)) * 192 / (Distance(ball.position, CPoint(863, 313)) + Distance(ball.position, CPoint(863, 505)))) + 313.5);
|
||||
if (ball.position.x >= 927 && ball.position.y >= 247 && ball.position.y <= 577) {
|
||||
if (ball.position.y < 313)
|
||||
xiy = 313;
|
||||
else if (ball.position.y > 505)
|
||||
xiy = 505;
|
||||
else
|
||||
xiy = ball.position.y;
|
||||
}
|
||||
else
|
||||
xiy = int((Distance(ball.position, CPoint(863, 313)) * 192 / (Distance(ball.position, CPoint(863, 313)) + Distance(ball.position, CPoint(863, 505)))) + 313.5);
|
||||
|
||||
if ((xit / 4) % 2)
|
||||
xiy += 30;
|
||||
@@ -2464,7 +2473,14 @@ void CStrategySystem::Goalie() {
|
||||
xiy -= 30;
|
||||
}
|
||||
|
||||
if (xiy < 303 || xiy > 507)
|
||||
if (ball.position.y < 313)
|
||||
xiy = 313;
|
||||
else if (ball.position.y > 505)
|
||||
xiy = 505;
|
||||
else
|
||||
xiy = ball.position.y;
|
||||
|
||||
if (xiy < 303 || xiy > 495)
|
||||
Position(HGOALIE, CPoint(xix, xiy));
|
||||
else
|
||||
Direction(HGOALIE, CPoint(xix, xiy));
|
||||
|
||||
Reference in new issue
Block a user