Skip to content

Commit 7f5673a

Browse files
committed
Merge branch 'master' into engine-release
2 parents 1f09ae6 + 090f754 commit 7f5673a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/src/main/battlecode/world/RobotControllerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ private void assertCanAttackRat(MapLocation loc, int cheeseConsumed) throws Game
966966

967967
MapLocation myLoc = this.getLocation();
968968

969-
if (!myLoc.isAdjacentTo(loc) || myType.isRatKingType() && myLoc.distanceSquaredTo(loc) > GameConstants.RAT_KING_ATTACK_DISTANCE_SQUARED) {
969+
if (!myLoc.isAdjacentTo(loc) && !(myType.isRatKingType() && myLoc.distanceSquaredTo(loc) <= GameConstants.RAT_KING_ATTACK_DISTANCE_SQUARED)) {
970970
throw new GameActionException(CANT_DO_THAT, "Rats can only attack adjacent squares!");
971971
}
972972

0 commit comments

Comments
 (0)