Skip to content

Commit 8fbe69a

Browse files
authored
Merge pull request #44 from battlecode/hpmutate
Track HP change on mutate
2 parents 514bd61 + 3cc3173 commit 8fbe69a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ public void transform() {
380380
public void mutate() {
381381
if (!canMutate()) return;
382382
this.level++;
383-
this.health += this.type.getMaxHealth(this.level) - this.type.getMaxHealth(this.level - 1);
383+
int healthIncrease = this.type.getMaxHealth(this.level) - this.type.getMaxHealth(this.level - 1);
384+
this.gameWorld.getMatchMaker().addAction(getID(), Action.CHANGE_HEALTH, healthIncrease);
385+
this.health += healthIncrease;
384386
}
385387

386388
/**

0 commit comments

Comments
 (0)