@@ -583,7 +583,7 @@ private void assertCanMarkTowerPattern(UnitType type, MapLocation loc) throws Ga
583583 + ") because the center is not a ruin" );
584584 }
585585
586- if (!this .gameWorld .isValidPatternCenter (loc )) {
586+ if (!this .gameWorld .isValidPatternCenter (loc , true )) {
587587 throw new GameActionException (CANT_DO_THAT ,
588588 "Cannot mark tower pattern centered at (" + loc .x + ", " + loc .y
589589 + ") because it is too close to the edge of the map" );
@@ -678,10 +678,10 @@ private void assertCanMarkResourcePattern(MapLocation loc) throws GameActionExce
678678 assertIsRobotType (this .robot .getType ());
679679 assertCanActLocation (loc , GameConstants .RESOURCE_PATTERN_RADIUS_SQUARED );
680680
681- if (!this .gameWorld .isValidPatternCenter (loc )) {
681+ if (!this .gameWorld .isValidPatternCenter (loc , false )) {
682682 throw new GameActionException (CANT_DO_THAT ,
683683 "Cannot mark resource pattern centered at (" + loc .x + ", " + loc .y
684- + ") because it is too close to the edge of the map" );
684+ + ") because it is blocked or too close to the edge of the map" );
685685 }
686686
687687 if (this .robot .getPaint () < GameConstants .MARK_PATTERN_PAINT_COST ){
@@ -750,7 +750,7 @@ private void assertCanCompleteTowerPattern(UnitType type, MapLocation loc) throw
750750 + ") because the team does not have enough money!" );
751751 }
752752
753- if (!this .gameWorld .isValidPatternCenter (loc )) {
753+ if (!this .gameWorld .isValidPatternCenter (loc , true )) {
754754 throw new GameActionException (CANT_DO_THAT ,
755755 "Cannot complete tower pattern centered at (" + loc .x + ", " + loc .y
756756 + ") because it is too close to the edge of the map" );
@@ -802,10 +802,10 @@ private void assertCanCompleteResourcePattern(MapLocation loc) throws GameAction
802802 assertIsRobotType (this .robot .getType ());
803803 assertCanActLocation (loc , GameConstants .RESOURCE_PATTERN_RADIUS_SQUARED );
804804
805- if (!this .gameWorld .isValidPatternCenter (loc )) {
805+ if (!this .gameWorld .isValidPatternCenter (loc , false )) {
806806 throw new GameActionException (CANT_DO_THAT ,
807807 "Cannot complete resource pattern centered at (" + loc .x + ", " + loc .y
808- + ") because it is too close to the edge of the map" );
808+ + ") because it is blocked or too close to the edge of the map" );
809809 }
810810
811811 boolean valid = this .gameWorld .checkResourcePattern (this .robot .getTeam (), loc );
0 commit comments