File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,14 @@ void ServerGameCycle::update(App& _app) {
8080 // Getting internet messages
8181 switch (connection.updateMessages ()) {
8282 case ConnectionCode::GameTurn:
83- #if CHECK_CORRECTION
84- SDL_Log (" Turn of opponent player: from %u to %u" , connection.lastPacket ->getData <Uint8>(2 ), connection.lastPacket ->getData <Uint8>(3 ));
85- #endif
86- field.clickMultiplayerOpponent (connection.lastPacket ->getData <Uint8>(2 ), connection.lastPacket ->getData <Uint8>(3 ));
87- // Making sound
88- // _app.sounds.play(SND_RESET);
83+ if (connection.lastPacket ->isBytesAvaliable (4 )) {
84+ #if CHECK_CORRECTION
85+ SDL_Log (" Turn of opponent player: from %u to %u" , connection.lastPacket ->getData <Uint8>(2 ), connection.lastPacket ->getData <Uint8>(3 ));
86+ #endif
87+ field.clickMultiplayerOpponent (connection.lastPacket ->getData <Uint8>(2 ), connection.lastPacket ->getData <Uint8>(3 ));
88+ // Making sound
89+ // _app.sounds.play(SND_RESET);
90+ }
8991 return ;
9092 }
9193}
You can’t perform that action at this time.
0 commit comments