Patched hole in client state machine
@@ -1622,14 +1622,19 @@ public class ClientStateMachine extends StateMachine implements IMalmoMessageLis
// Ping the agent - if serverHasFiredStartingPistol is true, we don't need to abort -
// we can simply set the wantsToQuit flag and end the mission cleanly.
// If serverHasFiredStartingPistol is false, then the mission isn't yet running, and
- // setting the quit flag will do nothing - so let the pingAgent method abort for us.
- if (!pingAgent(!this.serverHasFiredStartingPistol))
+ // setting the quit flag will do nothing - so we need to abort.
+ if (!pingAgent(false))
+ {
+ if (!this.serverHasFiredStartingPistol)
+ onMissionEnded(ClientState.ERROR_LOST_AGENT, "Lost contact with the agent");
+ else
{
System.out.println("Error - agent is not responding to pings.");
this.wantsToQuit = true;
this.quitCode = MalmoMod.AGENT_UNRESPONSIVE_CODE;
}
}
+ }
// Check here to see whether the player has died or not:
if (!this.playerDied && Minecraft.getMinecraft().thePlayer.isDead)
