]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Display map shortname and longname in welcome message
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:22:33 +0000 (15:22 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Sep 2022 05:22:33 +0000 (15:22 +1000)
qcsrc/client/main.qc

index eb4cb7ba87e7f2b1312210f0914417d347217b1c..da5f2fbfb70f3e6abfd864601e6337d2409d8b00 100644 (file)
@@ -1434,6 +1434,16 @@ bool net_handle_ServerWelcome()
 
        msg = strcat(msg, "^8\n\n", strcat(_("Gametype:"), " ^1", MapInfo_Type_ToText(gametype)), "^8\n");
 
+       msg = strcat(msg, "^8\n", _("Map:"), " ^2");
+       if (world.message == "")
+               msg = strcat(msg, mi_shortname, "^8\n");
+       else
+       {
+               int i = strstrofs(world.message, " by ", 0); // matches _MapInfo_Generate()
+               string longname = i >= 0 ? substring(world.message, 0, i) : world.message;
+               msg = strcat(msg, (strcasecmp(longname, mi_shortname) ? strcat(mi_shortname, " ^7// ^2") : ""), longname, "^8\n");
+       }
+
        if (srv_minplayers || srv_maxplayers)
        {
                msg = strcat(msg, "^8\n", _("This match supports"), " ^5");