Skip to content

Commit c004ffb

Browse files
committed
Fix baby rat lost raw cheese when converting to king
1 parent 3f6c631 commit c004ffb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,9 @@ public void becomeRatKing() throws GameActionException {
11461146
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), -GameConstants.RAT_KING_UPGRADE_CHEESE_COST);
11471147
health = Math.min(health, UnitType.RAT_KING.health);
11481148

1149-
robot.becomeRatKing(health);
1149+
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), robot.getCheese());
1150+
this.robot.addCheese(-this.robot.getCheese());
1151+
this.robot.becomeRatKing(health);
11501152

11511153

11521154
for (Direction d : Direction.allDirections()) {

0 commit comments

Comments
 (0)