From 33a7fa39218cd5b1f9331372c70aa9c4979c2f55 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Sun, 6 Nov 2022 18:03:06 -0800 Subject: [PATCH] Fix second player no input bug --- Flight.vcxproj | 2 +- server.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Flight.vcxproj b/Flight.vcxproj index 710df76..dae89ea 100644 --- a/Flight.vcxproj +++ b/Flight.vcxproj @@ -140,7 +140,7 @@ Level3 true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions);DEBUG_RENDERING; + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);DEBUG_RENDERING;SERVER_ADDRESS="127.0.0.1" true C:\Users\Cameron\Documents\flight\thirdparty\enet\include;C:\Users\Cameron\Documents\flight\thirdparty\Chipmunk2D\include\chipmunk;C:\Users\Cameron\Documents\flight\thirdparty;C:\Users\Cameron\Documents\flight\thirdparty\Chipmunk2D\include;C:\Users\Cameron\Documents\flight\thirdparty\minilzo true diff --git a/server.c b/server.c index 5ac5a3b..9a25bd8 100644 --- a/server.c +++ b/server.c @@ -124,6 +124,7 @@ void server(void* data) event.peer->data = (void*)player_slot; gs.players[player_slot] = (struct Player){ 0 }; gs.players[player_slot].connected = true; + player_to_latest_id_processed[player_slot] = 0; #ifdef UNLOCK_ALL gs.players[player_slot].unlocked_bombs = true; #endif @@ -134,9 +135,9 @@ void server(void* data) case ENET_EVENT_TYPE_RECEIVE: { - // Log("A packet of length %zu was received on channel %u.\n", - // event.packet->dataLength, - // event.channelID); + //Log("A packet of length %zu was received on channel %u.\n", + // event.packet->dataLength, + //event.channelID); size_t length = event.packet->dataLength; if (length != sizeof(struct ClientToServer))