From f3ea628feaee6250291f33a09aaa1361a469188f Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 24 Nov 2018 21:24:05 -0500 Subject: [PATCH] Update server name instantly on change --- src/mserv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mserv.c b/src/mserv.c index a84266c8..e339e403 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -206,7 +206,7 @@ static void ServerName_OnChange(void); #define DEF_PORT "28900" consvar_t cv_masterserver = {"masterserver", "ms.srb2.org:"DEF_PORT, CV_SAVE, NULL, MasterServer_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_servername = {"servername", "SRB2 server", CV_SAVE, NULL, ServerName_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_servername = {"servername", "SRB2 server", CV_SAVE|CV_CALL|CV_NOINIT, NULL, ServerName_OnChange, 0, NULL, NULL, 0, 0, NULL}; INT16 ms_RoomId = -1; @@ -978,8 +978,8 @@ void MasterClient_Ticker(void) static void ServerName_OnChange(void) { - UnregisterServer(); - RegisterServer(); + if (con_state == MSCS_REGISTERED) + AddToMasterServer(false); } static void MasterServer_OnChange(void)