diff --git a/代码/workspace_robo4/robocode.api/src/main/java/robocode/JuniorRobot.java b/代码/workspace_robo4/robocode.api/src/main/java/robocode/JuniorRobot.java index 23675ca..62019b6 100644 --- a/代码/workspace_robo4/robocode.api/src/main/java/robocode/JuniorRobot.java +++ b/代码/workspace_robo4/robocode.api/src/main/java/robocode/JuniorRobot.java @@ -898,9 +898,9 @@ public class JuniorRobot extends _RobotBase implements IJuniorRobot { // Make sure that we rescan if the robot did not execute anything this turn. // When the robot executes the currentTurn will automatically be increased by 1, // So when the turn stays the same, the robot did not take any action this turn. - if (lastTurn == currentTurn) { - peer.rescan(); // Spend a turn on rescanning - } + + peer.rescan(); // Spend a turn on rescanning + } } } diff --git a/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/battle/peer/RobotPeer.java b/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/battle/peer/RobotPeer.java index c41d9fe..970cff5 100644 --- a/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/battle/peer/RobotPeer.java +++ b/代码/workspace_robo4/robocode.battle/src/main/java/net/sf/robocode/battle/peer/RobotPeer.java @@ -165,7 +165,7 @@ public final class RobotPeer implements IRobotPeerBattle, IRobotPeer { teamMembers = null; isTeamLeader = false; teamIndex = -1; // Must be set to -1 when robot is not in a team - } else { + } else if(team != null){ teamName = team.getName(); teamMembers = team.getMemberNames(); isTeamLeader = team.size() == 1; // That is current team size, more might follow later. First robot is leader