Skip to content

Commit 97db510

Browse files
committed
Stop negative robot health issue on traps
1 parent 1174938 commit 97db510

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

engine/src/main/battlecode/world/RobotControllerImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -829,10 +829,16 @@ public void move(Direction d) throws GameActionException {
829829
// kill this rat
830830
crushedRobot.addHealth(-crushedRobot.getHealth());
831831
}
832-
processTrapsAtLocation(newLoc);
832+
// processTrapsAtLocation(newLoc);
833833
}
834834

835835
this.robot.translateLocation(d.dx, d.dy);
836+
837+
for (int i = 0; i < curLocs.length; i++) {
838+
MapLocation newLoc = curLocs[i].add(d);
839+
processTrapsAtLocation(newLoc);
840+
}
841+
836842
this.robot.addMovementCooldownTurns(d);
837843

838844
}

0 commit comments

Comments
 (0)