Fixed a bug that game client tries to send turning mode packet when there is no socketThread

- add a if statement to check if socketThread is initialized before sending packet.

#story[1278]
This commit is contained in:
Haoming Yin
2017-09-23 21:04:57 +12:00
parent 1042817e4e
commit 8dfdb228e9
@@ -461,10 +461,12 @@ public class GameClient {
}
public void sendToggleTurningModePacket() {
if (gameKeyBind.isContinuouslyTurning()) {
socketThread.sendBoatAction(BoatAction.CONTINUOUSLY_TURNING);
} else {
socketThread.sendBoatAction(BoatAction.DEFAULT_TURNING);
if (socketThread != null) {
if (gameKeyBind.isContinuouslyTurning()) {
socketThread.sendBoatAction(BoatAction.CONTINUOUSLY_TURNING);
} else {
socketThread.sendBoatAction(BoatAction.DEFAULT_TURNING);
}
}
}
}