Skip to content

Commit 89210b5

Browse files
author
bytekeeper
committed
Thanks @JasperGeurtz at pointing out this was wrong on frame 0.
1 parent 2dfb9fa commit 89210b5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/java/bwapi/Game.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,11 @@ void unitHide(final int id) {
262262
}
263263

264264
void onFrame(final int frame) {
265-
allUnits = Collections.unmodifiableList(visibleUnits.stream()
266-
.map(i -> units[i])
267-
.collect(Collectors.toList()));
265+
if (frame > 0) {
266+
allUnits = Collections.unmodifiableList(visibleUnits.stream()
267+
.map(i -> units[i])
268+
.collect(Collectors.toList()));
269+
}
268270
getAllUnits().forEach(u -> u.updatePosition(frame));
269271
}
270272

0 commit comments

Comments
 (0)