Skip to content

Commit aefabd3

Browse files
authored
Merge pull request #146 from battlecode/carrier-attack-fix
Fixed resource loss on carrier attacks
2 parents e2e81e7 + 806c911 commit aefabd3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

engine/src/main/battlecode/world/robots/InternalCarrier.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ public InternalCarrier(GameWorld gw, int id, RobotType type, MapLocation loc, Te
3333
*/
3434
private void emptyResources() {
3535
for (ResourceType rType : ResourceType.values()) {
36-
this.inventory.addResource(rType, -1*this.inventory.getResource(rType));
36+
int amount = -1*this.inventory.getResource(rType);
37+
this.inventory.addResource(rType, amount);
38+
this.gameWorld.getTeamInfo().addResource(rType, getTeam(), amount);
3739
}
3840
}
3941

specs/specs.md.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@
298298
- Passive resource gain number fixed
299299
- Engine Fixes:
300300
- Fix bug in checking islands held win condition
301+
- Carrier attacks correctly deduct resources from teamInfo
301302

302303
- Version 2.0.1 (January 18, 2023)
303304
- Balance Changes:

0 commit comments

Comments
 (0)