diff options
author | rubidium42 <rubidium@openttd.org> | 2021-05-04 19:30:25 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-06 20:33:26 +0200 |
commit | dcef3209a61acf818f3114d07e3378bc7e61a9c1 (patch) | |
tree | 22d2fb4000dbf19832cc7c0ccb82daaf2fb22867 /src/network/network_gamelist.h | |
parent | dc0591728739c2c8fa68dbfeb418239fbfb39383 (diff) | |
download | openttd-dcef3209a61acf818f3114d07e3378bc7e61a9c1.tar.xz |
Codechange: [Network] Use new/delete instead of calloc/free for NetworkGameList
Diffstat (limited to 'src/network/network_gamelist.h')
-rw-r--r-- | src/network/network_gamelist.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/network/network_gamelist.h b/src/network/network_gamelist.h index 31b3bc3e6..6ef9d8e41 100644 --- a/src/network/network_gamelist.h +++ b/src/network/network_gamelist.h @@ -16,12 +16,17 @@ /** Structure with information shown in the game list (GUI) */ struct NetworkGameList { - NetworkGameInfo info; ///< The game information of this server - std::string connection_string; ///< Address of the server - bool online; ///< False if the server did not respond (default status) - bool manually; ///< True if the server was added manually - uint8 retries; ///< Number of retries (to stop requerying) - NetworkGameList *next; ///< Next pointer to make a linked game list + NetworkGameList(const std::string &connection_string, bool manually = false) : + connection_string(connection_string), manually(manually) + { + } + + NetworkGameInfo info = {}; ///< The game information of this server + std::string connection_string; ///< Address of the server + bool online = false; ///< False if the server did not respond (default status) + bool manually = false; ///< True if the server was added manually + uint8 retries = 0; ///< Number of retries (to stop requerying) + NetworkGameList *next = nullptr; ///< Next pointer to make a linked game list }; /** Game list of this client */ |