Skip to content

Commit afe8c5e

Browse files
author
Jasper Geurtz
committed
Revert Game.getForces index 0 exclusion (C++ BWAPIClient legacy bug)
1 parent 7cb596f commit afe8c5e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎src/main/java/bwapi/Game.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,8 @@ void init() {
162162
forces[id] = new Force(gameData().getForces(id), id, this);
163163
}
164164

165-
forceSet = forceCount > 1
166-
? Collections.unmodifiableList(Arrays.asList(forces).subList(1, forceCount))
167-
: Collections.emptyList();
165+
// Note: C++ BWAPIClient starts at i = 1, which is a legacy bug in BWAPIClient (Server.cpp 0-indexes forces[0..3]).
166+
forceSet = Collections.unmodifiableList(Arrays.asList(forces));
168167

169168
final int playerCount = gameData().getPlayerCount();
170169
players = new Player[playerCount];

0 commit comments

Comments
 (0)