Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 6271: Offboard units to the North and West will be placed properly #6308

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/Compute.java
Original file line number Diff line number Diff line change
Expand Up @@ -7636,7 +7636,7 @@ public static boolean isFlakAttack(Entity attacker, Entity target) {

public static int turnsTilHit(int distance) {
final int turnsTilHit;
// See indirect flight times table, TO p181
// See indirect flight times table, TO:AR p149
if (distance <= Board.DEFAULT_BOARD_HEIGHT) {
turnsTilHit = 0;
} else if (distance <= (8 * Board.DEFAULT_BOARD_HEIGHT)) {
Expand Down
4 changes: 2 additions & 2 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10272,7 +10272,7 @@ public void deployOffBoard(int round) {
case NORTH:
setPosition(new Coords((game.getBoard().getWidth() / 2)
+ (game.getBoard().getWidth() % 2),
-getOffBoardDistance()));
-getOffBoardDistance() - 1));
setFacing(3);
break;
case SOUTH:
Expand All @@ -10290,7 +10290,7 @@ public void deployOffBoard(int round) {
setFacing(5);
break;
case WEST:
setPosition(new Coords(-getOffBoardDistance(), (game.getBoard()
setPosition(new Coords(-getOffBoardDistance() - 1, (game.getBoard()
.getHeight() / 2) + (game.getBoard().getHeight() % 2)));
setFacing(1);
break;
Expand Down
15 changes: 1 addition & 14 deletions megamek/src/megamek/common/actions/ArtilleryAttackAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,7 @@ public ArtilleryAttackAction(int entityId, int targetType, int targetId,
turnsTilHit = 2;
}
} else {
// See indirect flight times table, TO p181
if (distance <= Board.DEFAULT_BOARD_HEIGHT) {
turnsTilHit = 0;
} else if (distance <= (8 * Board.DEFAULT_BOARD_HEIGHT)) {
turnsTilHit = 1;
} else if (distance <= (15 * Board.DEFAULT_BOARD_HEIGHT)) {
turnsTilHit = 2;
} else if (distance <= (21 * Board.DEFAULT_BOARD_HEIGHT)) {
turnsTilHit = 3;
} else if (distance <= (26 * Board.DEFAULT_BOARD_HEIGHT)) {
turnsTilHit = 4;
} else {
turnsTilHit = 5;
}
turnsTilHit = Compute.turnsTilHit(distance);
}
}
return;
Expand Down
Loading