Skip to content

Commit 4fc48a6

Browse files
committed
Fix quitting in main menu leading to continuous error messages
1 parent cd0f2d0 commit 4fc48a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/java/bwapi/BWClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public void startGame(boolean autoContinue) {
3737

3838
do {
3939
while (!getGame().isInGame()) {
40+
if (!client.isConnected()) {
41+
return;
42+
}
4043
client.update(handler);
4144
}
4245
while (getGame().isInGame()) {

src/main/java/bwapi/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ boolean connect() {
134134
int latest = 0;
135135
for(int i = 0; i < GameTable.MAX_GAME_INSTANCES; i++) {
136136
GameInstance gameInstance = gameTable.gameInstances[i];
137-
System.out.println(i + " | " + gameInstance.serverProcessID + " | " + gameInstance.isConnected + " | " + gameInstance.lastKeepAliveTime);
137+
System.out.println(i + " | " + gameInstance.serverProcessID + " | " + (gameInstance.isConnected ? 1 : 0) + " | " + gameInstance.lastKeepAliveTime);
138138
if (gameInstance.serverProcessID != 0 && !gameInstance.isConnected) {
139139
if ( gameTableIndex == -1 || latest == 0 || gameInstance.lastKeepAliveTime < latest ) {
140140
latest = gameInstance.lastKeepAliveTime;

0 commit comments

Comments
 (0)