File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
engine/src/main/battlecode/world Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1031,11 +1031,13 @@ public void squeak(InternalRobot robot, Message message) {
10311031 MapLocation robotLoc = robot .getLocation ();
10321032 MapLocation [] locations = getAllLocationsWithinRadiusSquared (robotLoc , GameConstants .SQUEAK_RADIUS_SQUARED , 0 ); // chirality doesn't matter here
10331033
1034+ HashSet <Integer > squeakedIDs = new HashSet <>();
10341035 for (MapLocation loc : locations ) {
10351036 InternalRobot otherRobot = getRobot (loc );
1036-
1037- if (otherRobot != null && (otherRobot .getType ().isCatType () || otherRobot .getTeam () == robot .getTeam ())) {
1037+
1038+ if (otherRobot != null && (otherRobot .getID () != robot . getID ()) && (! squeakedIDs . contains ( otherRobot . getID ())) && ( otherRobot . getType ().isCatType () || otherRobot .getTeam () == robot .getTeam ())) {
10381039 otherRobot .addMessage (message .copy ());
1040+ squeakedIDs .add (otherRobot .getID ());
10391041 }
10401042 }
10411043
You can’t perform that action at this time.
0 commit comments