From 53bc001181b5bfa5490400fc7493b2fdc5abfbde Mon Sep 17 00:00:00 2001 From: Aaron Dean <8dino2@gmail.com> Date: Thu, 18 Jan 2024 16:46:31 -0500 Subject: [PATCH] Minor rearranging --- source/g_libcurl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/g_libcurl.c b/source/g_libcurl.c index 0977a0d54..09adb0e4f 100644 --- a/source/g_libcurl.c +++ b/source/g_libcurl.c @@ -113,14 +113,16 @@ void announce_server_populating() return; } - json_t *srv_announce = json_object(); int playercount = CountRealPlayers(); - // Do not announce if player count is less than 25% of maxclients float threshold = fmax((game.maxclients * 0.2), 3); if (playercount < threshold) return; + // All the checks are out of the way, now to form the data and send it + + json_t *srv_announce = json_object(); + json_object_set_new(srv_announce, "hostname", json_string(hostname->string)); json_object_set_new(srv_announce, "server_ip", json_string(server_ip->string)); json_object_set_new(srv_announce, "server_port", json_string(server_port->string));