]> 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 18f5cacc68fb427d3346b98aa98fb1a6f7b701e7..512f61ad231ae5d4255ec197a7b4d0667416220a 100644 (file)
@@ -208,10 +208,13 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
                WriteString(MSG_ENTITY, teamscores_label(i));
                WriteByte(MSG_ENTITY, teamscores_flags(i));
        }
-       // for some reason ScoreInfo_SendEntity is called twice on client connection
-       // FIXME send the welcome message only once
+       // 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
-       SendWelcomemessage_msg_type(this, false, MSG_ENTITY);
+       if (welcome_msg_too)
+               SendWelcomeMessage(to, MSG_ENTITY);
        return true;
 }