]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix #2684 "The welcome dialog randomly fails to appear"
authorterencehill <piuntn@gmail.com>
Sun, 10 Apr 2022 21:13:39 +0000 (23:13 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 10 Apr 2022 21:13:39 +0000 (23:13 +0200)
This commit partially reverts 47d309fd (only the "Don't send the welcome message twice on connection." part, the remaining part is implemented in a different way)

qcsrc/server/scores.qc

index 38fd7f40e16ee2a2c76d3db8bd476f08fcc7ed55..7e90b4f082e812a127011f5d10723bc6d2eeef55 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 = (time < CS(this).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;
-       }
        return true;
 }