We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d681bf commit 2189b6aCopy full SHA for 2189b6a
1 file changed
engine/src/main/battlecode/world/ObjectInfo.java
@@ -184,11 +184,12 @@ public void destroyRobot(int id) {
184
MapLocation loc = robot.getLocation();
185
gameRobotsByID.remove(id);
186
try {
187
- dynamicBodyExecOrder.remove(id);
+ this.dynamicBodyExecOrder.remove(dynamicBodyExecOrder.indexOf(id)*-1);
188
} catch (ArrayIndexOutOfBoundsException e) {
189
// This should never happen, but if it does, we don't want to crash.
190
// Just log it and move on.
191
System.err.println("Warning: Tried to remove robot ID " + id + " from dynamicBodyExecOrder, but it was not found.");
192
+ throw new ArrayIndexOutOfBoundsException();
193
}
194
195
if (loc != null) {
0 commit comments