MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / NetworkGameListRemoveItem

Function NetworkGameListRemoveItem

src/network/network_gamelist.cpp:52–61  ·  view source on GitHub ↗

* Remove an item from the gamelist linked list * @param remove pointer to the item to be removed */

Source from the content-addressed store, hash-verified

50 * @param remove pointer to the item to be removed
51 */
52void NetworkGameListRemoveItem(NetworkGame *remove)
53{
54 auto it = std::ranges::find_if(_network_game_list, [&remove](const auto &item) { return item.get() == remove; });
55 if (it != std::end(_network_game_list)) {
56 _network_game_list.erase(it);
57
58 NetworkRebuildHostList();
59 UpdateNetworkGameWindow();
60 }
61}
62
63/**
64 * Remove all servers that have not recently been updated.

Callers 1

OnKeyPressMethod · 0.85

Calls 5

NetworkRebuildHostListFunction · 0.85
UpdateNetworkGameWindowFunction · 0.85
endFunction · 0.50
getMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected