]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Rename SendWelcomemessage_msg_type to SendWelcomeMessage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 38fd7f40e16ee2a2c76d3db8bd476f08fcc7ed55..512f61ad231ae5d4255ec197a7b4d0667416220a 100644 (file)
@@ -194,7 +194,6 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
        }
 }
 
-.bool welcome_msg_already_sent_on_connection;
 bool ScoreInfo_SendEntity(entity this, entity to, int sf)
 {
        float i;
@@ -209,14 +208,13 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
                WriteString(MSG_ENTITY, teamscores_label(i));
                WriteByte(MSG_ENTITY, teamscores_flags(i));
        }
-       bool welcome_msg_too = (!to.welcome_msg_already_sent_on_connection);
+       // prevent sending the welcome message again when score types are sent again because the scoring system has changed
+       // it can happen in some game modes like Race when the qualyfing session ends and the race starts
+       bool welcome_msg_too = (!CS(to) || time < CS(to).jointime + 5);
        WriteByte(MSG_ENTITY, welcome_msg_too);
        // welcome message is sent here because it needs to know the gametype
        if (welcome_msg_too)
-       {
-               SendWelcomemessage_msg_type(this, false, MSG_ENTITY);
-               to.welcome_msg_already_sent_on_connection = true;
-       }
+               SendWelcomeMessage(to, MSG_ENTITY);
        return true;
 }