]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Send the welcome message together with the gametype on connection in order to avoid...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index 07c400f5d3bf31337449629435cfe5f1dc5949c7..ac3f52c72f446fb29ec0074d9eb43dfe6d2bbe9f 100644 (file)
@@ -194,6 +194,7 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
        }
 }
 
+int Welcomemessage_too = 1;
 bool ScoreInfo_SendEntity(entity this, entity to, int sf)
 {
        float i;
@@ -208,6 +209,15 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
                WriteString(MSG_ENTITY, teamscores_label(i));
                WriteByte(MSG_ENTITY, teamscores_flags(i));
        }
+       WriteByte(MSG_ENTITY, Welcomemessage_too);
+       // for some reason ScoreInfo_SendEntity is called twice on client connection
+       // send the welcome message only once
+       if (Welcomemessage_too)
+       {
+               // welcome message is sent here because it needs to know the gametype
+               SendWelcomemessage_msg_type(this, false, MSG_ENTITY);
+               Welcomemessage_too = 0;
+       }
        return true;
 }