]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix Welcome message "popping up multiple times in the middle of a match"
authorterencehill <piuntn@gmail.com>
Tue, 26 Apr 2022 21:47:06 +0000 (23:47 +0200)
committerterencehill <piuntn@gmail.com>
Tue, 26 Apr 2022 21:47:06 +0000 (23:47 +0200)
qcsrc/server/scores.qc

index 950b1114e676b890346da9fdd628abafb40a9381..b6244ee24ba2a5e8eb820e9a59581433f8c34374 100644 (file)
@@ -210,12 +210,11 @@ bool ScoreInfo_SendEntity(entity this, entity to, int sf)
        }
        // 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
-       // NOTE: CS(this) is not initialized yet when a local client connects to a local dedicated server
-       bool welcome_msg_too = (!CS(this) || time < CS(this).jointime + 5);
+       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);
+               SendWelcomemessage_msg_type(to, false, MSG_ENTITY);
        return true;
 }