diff --git a/Source/Core/Core/NetPlayClient.cpp b/Source/Core/Core/NetPlayClient.cpp index 18241ecd82..2c435a5375 100644 --- a/Source/Core/Core/NetPlayClient.cpp +++ b/Source/Core/Core/NetPlayClient.cpp @@ -60,23 +60,10 @@ NetPlayClient::~NetPlayClient() // called from ---GUI--- thread NetPlayClient::NetPlayClient(const std::string& address, const u16 port, NetPlayUI* dialog, const std::string& name, bool traversal, const std::string& centralServer, u16 centralPort) : m_dialog(dialog) - , m_client(nullptr) - , m_server(nullptr) - , m_is_running(false) - , m_do_loop(true) - , m_target_buffer_size() - , m_local_player(nullptr) - , m_current_game(0) - , m_is_recording(false) - , m_pid(0) - , m_connecting(false) - , m_traversal_client(nullptr) + , m_player_name(name) { - m_target_buffer_size = 20; ClearBuffers(); - m_player_name = name; - if (!traversal) { //Direct Connection diff --git a/Source/Core/Core/NetPlayClient.h b/Source/Core/Core/NetPlayClient.h index d9548e177e..30f7f5421b 100644 --- a/Source/Core/Core/NetPlayClient.h +++ b/Source/Core/Core/NetPlayClient.h @@ -96,26 +96,26 @@ protected: Common::FifoQueue m_pad_buffer[4]; Common::FifoQueue m_wiimote_buffer[4]; - NetPlayUI* m_dialog; + NetPlayUI* m_dialog = nullptr; - ENetHost* m_client; - ENetPeer* m_server; + ENetHost* m_client = nullptr; + ENetPeer* m_server = nullptr; std::thread m_thread; std::string m_selected_game; - std::atomic m_is_running; - std::atomic m_do_loop; + std::atomic m_is_running{false}; + std::atomic m_do_loop{true}; - unsigned int m_target_buffer_size; + unsigned int m_target_buffer_size = 20; - Player* m_local_player; + Player* m_local_player = nullptr; - u32 m_current_game; + u32 m_current_game = 0; PadMappingArray m_pad_map; PadMappingArray m_wiimote_map; - bool m_is_recording; + bool m_is_recording = false; private: enum class ConnectionState @@ -139,14 +139,14 @@ private: bool m_is_connected = false; ConnectionState m_connection_state = ConnectionState::Failure; - PlayerId m_pid; + PlayerId m_pid = 0; std::map m_players; std::string m_host_spec; std::string m_player_name; - bool m_connecting; - TraversalClient* m_traversal_client; + bool m_connecting = false; + TraversalClient* m_traversal_client = nullptr; - u32 m_timebase_frame; + u32 m_timebase_frame = 0; }; void NetPlay_Enable(NetPlayClient* const np);