Skip to content

Commit 8192ea6

Browse files
authored
Rescale Unit array on >= not > (off-by-one)
Only triggered where games go over the 10K units limit
1 parent 23ad3be commit 8192ea6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/bwapi/Game.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void init() {
288288
}
289289

290290
void unitCreate(final int id) {
291-
if (id > units.length) {
291+
if (id >= units.length) {
292292
//rescale unit array if needed
293293
final Unit[] largerUnitsArray = new Unit[2 * units.length];
294294
System.arraycopy(units, 0, largerUnitsArray, 0, units.length);

0 commit comments

Comments
 (0)