]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Display mapinfo titlestring in Welcome message, handle title the same in all code...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 58473889bb423d0d71334acd55f589922335cecb..80a98b25fbef06ba6c0a395410740a1fe780ad6a 100644 (file)
@@ -1041,16 +1041,27 @@ void ClientPreConnect(entity this)
 // also note that they aren't all registered mutators, e.g. jetpack, low gravity
 void SendWelcomeMessage(entity this, int msg_type)
 {
-       WriteByte(msg_type, boolean(autocvar_g_campaign));
        if (boolean(autocvar_g_campaign))
        {
+               WriteByte(msg_type, 1);
                WriteByte(msg_type, Campaign_GetLevelNum());
                return;
        }
+
+       int flags = 0;
+       if (CS(this).version_mismatch)
+               flags |= 2;
+       if (CS(this).version < autocvar_gameversion)
+               flags |= 4;
+       MapInfo_Get_ByName(mi_shortname, 0, NULL);
+       WriteByte(msg_type, flags);
+
        WriteString(msg_type, autocvar_hostname);
        WriteString(msg_type, autocvar_g_xonoticversion);
-       WriteByte(msg_type, CS(this).version_mismatch);
-       WriteByte(msg_type, (CS(this).version < autocvar_gameversion));
+
+       WriteString(msg_type, MapInfo_Map_titlestring);
+       MapInfo_ClearTemps();
+
        WriteByte(msg_type, autocvar_g_warmup > 1 ? autocvar_g_warmup : map_minplayers);
        WriteByte(msg_type, GetPlayerLimit());
 
@@ -1204,6 +1215,11 @@ void ClientConnect(entity this)
                localcmd("\nsv_hook_firstjoin\n");
        }
 }
+
+.string shootfromfixedorigin;
+.entity chatbubbleentity;
+void player_powerups_remove_all(entity this);
+
 /*
 =============
 ClientDisconnect
@@ -1211,9 +1227,6 @@ ClientDisconnect
 Called when a client disconnects from the server
 =============
 */
-.entity chatbubbleentity;
-void player_powerups_remove_all(entity this);
-
 void ClientDisconnect(entity this)
 {
        assert(IS_CLIENT(this), return);
@@ -1257,6 +1270,8 @@ void ClientDisconnect(entity this)
 
        RemoveGrapplingHooks(this);
 
+       strfree(this.shootfromfixedorigin);
+
        // Here, everything has been done that requires this player to be a client.
 
        this.flags &= ~FL_CLIENT;
@@ -2124,7 +2139,6 @@ void show_entnum(entity this)
                this.wp_aimed = ent;
 }
 
-.string shootfromfixedorigin;
 .bool dualwielding_prev;
 bool PlayerThink(entity this)
 {
@@ -2226,7 +2240,7 @@ bool PlayerThink(entity this)
        FixPlayermodel(this);
 
        if (this.shootfromfixedorigin != autocvar_g_shootfromfixedorigin) {
-               this.shootfromfixedorigin = autocvar_g_shootfromfixedorigin;
+               strcpy(this.shootfromfixedorigin, autocvar_g_shootfromfixedorigin);
                stuffcmd(this, sprintf("\ncl_shootfromfixedorigin \"%s\"\n", autocvar_g_shootfromfixedorigin));
        }