Skip to content

Commit 7554821

Browse files
authored
Merge pull request #67 from justinottesen/become_king_lose_raw_cheese
Fix baby rat lost raw cheese when converting to king
2 parents 33324a9 + c004ffb commit 7554821

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
@@ -1148,7 +1148,9 @@ public void becomeRatKing() throws GameActionException {
11481148
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), -GameConstants.RAT_KING_UPGRADE_CHEESE_COST);
11491149
health = Math.min(health, UnitType.RAT_KING.health);
11501150

1151-
robot.becomeRatKing(health);
1151+
this.gameWorld.getTeamInfo().addCheese(this.getTeam(), robot.getCheese());
1152+
this.robot.addCheese(-this.robot.getCheese());
1153+
this.robot.becomeRatKing(health);
11521154

11531155

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

0 commit comments

Comments
 (0)