Skip to content

Commit aae3ba3

Browse files
committed
fix trap removal
1 parent 8784e65 commit aae3ba3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

engine/src/main/battlecode/server/GameMaker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,10 @@ public void addPlaceTrapAction(int trapID, MapLocation loc, Team team, TrapType
625625
});
626626
}
627627

628-
public void addRemoveTrapAction(int trapID, Team team) {
628+
public void addRemoveTrapAction(MapLocation loc, Team team) {
629629
applyToBuilders((builder) -> {
630630
byte teamID = TeamMapping.id(team);
631-
int action = RemoveTrap.createRemoveTrap(builder, trapID, teamID);
631+
int action = RemoveTrap.createRemoveTrap(builder, locationToInt(loc), teamID);
632632
builder.addAction(action, Action.RemoveTrap);
633633
});
634634
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public void removeRatTrap(MapLocation loc) throws GameActionException {
371371
assertCanRemoveRatTrap(loc);
372372
Trap trap = this.gameWorld.getTrap(loc);
373373
this.gameWorld.removeTrap(loc);
374-
this.gameWorld.getMatchMaker().addRemoveTrapAction(trap.getId(), trap.getTeam());
374+
this.gameWorld.getMatchMaker().addRemoveTrapAction(trap.getLocation(), trap.getTeam());
375375
}
376376

377377
@Override
@@ -405,7 +405,7 @@ public void removeCatTrap(MapLocation loc) throws GameActionException {
405405
assertCanRemoveCatTrap(loc);
406406
Trap trap = this.gameWorld.getTrap(loc);
407407
this.gameWorld.removeTrap(loc);
408-
this.gameWorld.getMatchMaker().addRemoveTrapAction(trap.getId(), trap.getTeam());
408+
this.gameWorld.getMatchMaker().addRemoveTrapAction(trap.getLocation(), trap.getTeam());
409409
}
410410

411411
@Override

0 commit comments

Comments
 (0)