Skip to content

Commit c83dbfc

Browse files
committed
enable enableFlag
1 parent 03981ab commit c83dbfc

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/main/java/bwapi/Client.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,10 +395,6 @@ public boolean getFlag(final int f) {
395395
return sharedMemory.get(GameOffset + 336 + f) != 0;
396396
}
397397

398-
public void setFlag(final int f, final boolean value) {
399-
sharedMemory.put(GameOffset + 336 + f, (byte) (value ? 1 : 0));
400-
}
401-
402398
public int mapWidth() {
403399
return sharedMemory.getInt(GameOffset + 340);
404400
}

src/main/java/bwapi/Game.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public boolean isFlagEnabled(final Flag flag) {
408408
}
409409

410410
public void enableFlag(final Flag flag) {
411-
gameData.setFlag(flag.value, true);
411+
addCommand(3, flag.value, 1);
412412
}
413413

414414
public Set<Unit> getUnitsOnTile(final int tileX, final int tileY) {

src/test/java/PlayTestListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public void onStart() {
1717
game = bwClient.getGame();
1818

1919
game.setLocalSpeed(20);
20+
game.enableFlag(Flag.UserInput);
21+
game.enableFlag(Flag.CompleteMapInformation);
2022
}
2123

2224
public void onFrame() {

0 commit comments

Comments
 (0)