Skip to content

Commit 3bd910d

Browse files
committed
respawn cheese after pickup if nonzero amount left
1 parent b7c667d commit 3bd910d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ public void pickUpCheese(MapLocation loc, int pickUpAmount) throws GameActionExc
513513
this.gameWorld.addCheese(loc, -pickUpAmount);
514514
this.robot.addCheese(pickUpAmount);
515515
this.gameWorld.getMatchMaker().addCheesePickUpAction(loc);
516+
517+
if (this.gameWorld.getCheeseAmount(loc) > 0)
518+
this.gameWorld.getMatchMaker().addCheeseSpawnAction(loc, this.gameWorld.getCheeseAmount(loc));
519+
516520
this.gameWorld.getTeamInfo().addCheeseCollected(getTeam(), pickUpAmount);
517521

518522
if (getType() == UnitType.RAT_KING) {

0 commit comments

Comments
 (0)