From 5cd6fb1595ce2d299fd04d4fcd7c604ffca7f45d Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Mon, 14 Apr 2025 21:35:02 +0200 Subject: [PATCH] Implement UIInstantAction::Update --- code/client/cl_instantAction.cpp | 35 +++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/code/client/cl_instantAction.cpp b/code/client/cl_instantAction.cpp index 475a7774..4bf90138 100644 --- a/code/client/cl_instantAction.cpp +++ b/code/client/cl_instantAction.cpp @@ -306,7 +306,40 @@ void UIInstantAction::Draw() void UIInstantAction::Update() { - // FIXME: unimplemented + numFoundServers = 0; + + // count the total number of servers from both server list + numServers = ServerListCount(serverList[0]); + if (serverList[1]) { + numServers += ServerListCount(serverList[1]); + } + + state = IA_FINISHED; + servers = new IAServer_t[numServers]; + + ServerListHalt(serverList[0]); + if (serverList[1]) { + ServerListHalt(serverList[1]); + } + + ServerListThink(serverList[0]); + if (serverList[1]) { + ServerListThink(serverList[1]); + } + + state = IA_SEARCHING; + + // Start updating the first list + doneList[0] = false; + ServerListClear(serverList[0]); + ServerListUpdate(serverList[0], true); + + // Update the second optional list + if (serverList[1]) { + doneList[1] = false; + ServerListClear(serverList[1]); + ServerListUpdate(serverList[1], true); + } } int UIInstantAction::AddServer(GServer server, const ServerGame_t& serverGame)