From 4e1343717142cac800217c3d517ec07c33df166a Mon Sep 17 00:00:00 2001 From: zhoudaxia <1018795633@qq.cin> Date: Fri, 26 Aug 2016 15:54:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=BB=E6=96=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../robocode.api/src/main/java/robocode/JuniorRobot.java | 6 +++--- .../src/main/java/net/sf/robocode/battle/peer/RobotPeer.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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