Skip to content

Commit 2189b6a

Browse files
author
Ian Gonzalez Hermosillo
committed
fix dynamic body exec order bug
1 parent 5d681bf commit 2189b6a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,12 @@ public void destroyRobot(int id) {
184184
MapLocation loc = robot.getLocation();
185185
gameRobotsByID.remove(id);
186186
try {
187-
dynamicBodyExecOrder.remove(id);
187+
this.dynamicBodyExecOrder.remove(dynamicBodyExecOrder.indexOf(id)*-1);
188188
} catch (ArrayIndexOutOfBoundsException e) {
189189
// This should never happen, but if it does, we don't want to crash.
190190
// Just log it and move on.
191191
System.err.println("Warning: Tried to remove robot ID " + id + " from dynamicBodyExecOrder, but it was not found.");
192+
throw new ArrayIndexOutOfBoundsException();
192193
}
193194

194195
if (loc != null) {

0 commit comments

Comments
 (0)