Skip to content

Commit 47e780d

Browse files
committed
onFrame is last event, so dont cache
1 parent f8d613b commit 47e780d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/main/java/bwapi/EventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class EventHandler implements Client.EventHandler {
88

99
public EventHandler(final BWEventListener eventListener, final Client client) {
1010
this.eventListener = eventListener;
11-
game = new Game(client);
11+
this.game = new Game(client);
1212
this.client = client;
1313
}
1414

src/main/java/bwapi/Game.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ public class Game {
5858
private List<Region> regionSet;
5959
// CHANGING
6060
private Unit[] units;
61-
private int frameCount = 0;
6261

6362
//CACHED
6463
private int randomSeed;
@@ -264,8 +263,6 @@ void unitHide(final int id) {
264263
}
265264

266265
void onFrame() {
267-
this.frameCount = gameData.getFrameCount();
268-
269266
if (getFrameCount() > 0) {
270267
allUnits = Collections.unmodifiableList(visibleUnits.stream()
271268
.map(i -> units[i])
@@ -386,7 +383,7 @@ public int getLatency() {
386383
}
387384

388385
public int getFrameCount() {
389-
return frameCount;
386+
return gameData.getFrameCount();
390387
}
391388

392389
public int getReplayFrameCount() {

0 commit comments

Comments
 (0)