From: terencehill Date: Sat, 13 Feb 2021 15:40:06 +0000 (+0100) Subject: Properly implement notification of no records available X-Git-Tag: xonotic-v0.8.5~560^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=efccc7ec36a933fb2543a63dcc7ae31ab129138f;p=xonotic%2Fxonotic-data.pk3dir.git Properly implement notification of no records available --- diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index 913bb696d..3beabbc41 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -40,9 +40,6 @@ string getrecords(int page) s = M_ARGV(1, string); MapInfo_ClearTemps(); - - if (s == "" && page == 0) - return "No records are available on this server for the current game mode.\n"; return s; } diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 9da86388c..9734bcef5 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -944,12 +944,18 @@ spawnfunc(worldspawn) maplist_reply = strzone(getmaplist()); lsmaps_reply = strzone(getlsmaps()); monsterlist_reply = strzone(getmonsterlist()); + bool records_available = false; for(int i = 0; i < 10; ++i) { string s = getrecords(i); - if (s) + if (s != "") + { records_reply[i] = strzone(s); + records_available = true; + } } + if (!records_available) + records_reply[0] = "No records available for the current game mode.\n"; ladder_reply = strzone(getladder()); rankings_reply = strzone(getrankings());