diff --git a/client/in_game.hpp b/client/in_game.hpp index 6a37fb9..304e946 100644 --- a/client/in_game.hpp +++ b/client/in_game.hpp @@ -33,7 +33,7 @@ protected: ConfigUtility* configUtil = nullptr; SurfaceManager* surfaceMgr = nullptr; UDPNetworkUtility* netUtil = nullptr; - int* playerID; + int* playerID = nullptr; }; #endif diff --git a/client/lobby.cpp b/client/lobby.cpp index 44f7d17..8b17141 100644 --- a/client/lobby.cpp +++ b/client/lobby.cpp @@ -122,6 +122,7 @@ void Lobby::Render(SDL_Surface* const screen) { //if a server has been selected, and this is the selected server if (selectedServer && selectedServer == &serverVector[i]) { + //draw the orange box SDL_FillRect(screen, &clip, SDL_MapRGB(screen->format, 255, 127, 39)); } font.DrawStringTo(serverVector[i].name, screen, clip.x, clip.y); @@ -148,14 +149,14 @@ void Lobby::MouseButtonUp(SDL_MouseButtonEvent const& button) { if (buttonMap["ping"]->MouseButtonUp(button) == Button::State::HOVER) { PingNetwork(); } - if (buttonMap["join"]->MouseButtonUp(button) == Button::State::HOVER) { + else if (buttonMap["join"]->MouseButtonUp(button) == Button::State::HOVER) { JoinRequest(selectedServer); } - if (buttonMap["back"]->MouseButtonUp(button) == Button::State::HOVER) { + else if (buttonMap["back"]->MouseButtonUp(button) == Button::State::HOVER) { SetNextScene(SceneList::MAINMENU); } //select a server (clicked within the bounds of the server box) - if (button.x > listBox.x && button.y > listBox.y && button.y < serverVector.size() * font.GetCharH() + listBox.y) { + else if (button.x > listBox.x && button.y > listBox.y && button.y < serverVector.size() * font.GetCharH() + listBox.y) { selectedServer = &serverVector[(button.y-listBox.y)/font.GetCharH()]; } else { diff --git a/docs/TODO.txt b/docs/TODO.txt index 091b719..034b614 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -4,4 +4,8 @@ Each client needs to know about each other client now. Have multiple players moving around the server at the same time keep the docs up to date!!!!! -Player's internals a weird. \ No newline at end of file +Player's internals a weird. + +clarify some of the names in the server project +reimplement the server's time system. +Overall, I think the server needs restructuring \ No newline at end of file