Skip to content

Commit

Permalink
Merge pull request #40 from battlecode/leadbug
Browse files Browse the repository at this point in the history
Process passive lead increases after charge
  • Loading branch information
j-mao authored Jan 5, 2022
2 parents 872c9a1 + dea141e commit 8c76d11
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions engine/src/main/battlecode/world/GameWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,6 @@ public boolean timeLimitReached() {
}

public void processEndOfRound() {
// Add lead resources to the map
if (this.currentRound % GameConstants.ADD_LEAD_EVERY_ROUNDS == 0)
for (int i = 0; i < this.lead.length; i++)
if (this.lead[i] > 0)
this.lead[i] += GameConstants.ADD_LEAD;

// Add lead resources to the team
this.teamInfo.addLead(Team.A, GameConstants.PASSIVE_LEAD_INCREASE);
Expand All @@ -429,6 +424,12 @@ public void processEndOfRound() {
if (anomaly == AnomalyType.VORTEX) causeVortexGlobal();
}

// Add lead resources to the map
if (this.currentRound % GameConstants.ADD_LEAD_EVERY_ROUNDS == 0)
for (int i = 0; i < this.lead.length; i++)
if (this.lead[i] > 0)
this.lead[i] += GameConstants.ADD_LEAD;

this.matchMaker.addTeamInfo(Team.A, this.teamInfo.getRoundLeadChange(Team.A), this.teamInfo.getRoundGoldChange(Team.A));
this.matchMaker.addTeamInfo(Team.B, this.teamInfo.getRoundLeadChange(Team.B), this.teamInfo.getRoundGoldChange(Team.B));
this.teamInfo.processEndOfRound();
Expand Down

0 comments on commit 8c76d11

Please sign in to comment.