@@ -139,23 +139,24 @@ private boolean shouldBuildSRP() throws GameActionException{
139
139
for (MapInfo mapInfo : info ) {
140
140
MapLocation tileLocation = mapInfo .getMapLocation ();
141
141
if (mapInfo .isResourcePatternCenter ()) { // will overlap already built SRP
142
- return false ;
142
+ // Resource centers at the very edge of the vision radius
143
+ // that are on the same x or y axis as the current are overlappable without issue
144
+ // relative locations (0,4) (-4,0) (0,-4) (4,0)
145
+ MapLocation relativeLocation = tileLocation .translate (-currentLocation .x , -currentLocation .y );
146
+ int x = relativeLocation .x ;
147
+ int y = relativeLocation .y ;
148
+ boolean case1 = x == 0 && (y == 4 || y == -4 );
149
+ boolean case2 = y == 0 && (x == 4 || x == -4 );
150
+ if (!(case1 || case2 )) {
151
+ return false ;
152
+ }
143
153
}
144
154
145
155
// Has wall or tower blocking
146
156
// Locations within SRP range
147
- // boolean in_range = mapInfo.getMapLocation().isWithinDistanceSquared(currentLocation, 1);
148
- // boolean isTower = mapInfo.hasRuin() && !noRobot;
149
- // if (in_range) {
150
- // // boolean isPaintedbyAlly =mapInfo.getPaint().isAlly();
151
- // if (mapInfo.isWall() || isTower) {
152
- // return false;
153
- // }
154
- // }
155
-
157
+ boolean noRobot = rc .senseRobotAtLocation (tileLocation ) == null ;
156
158
// cant build if there is uncompleted ruin
157
159
// this makes sure SRPs wont overlap onto TowerPatterns
158
- boolean noRobot = rc .senseRobotAtLocation (tileLocation ) == null ;
159
160
boolean noTower = mapInfo .hasRuin () && noRobot ;
160
161
if (noTower ) {
161
162
return false ;
0 commit comments