Commit MetaInfo

Revisionb5baa0b72f77bc2d8675507ed3824a87fe10cbd8 (tree)
Time2021-10-10 06:15:44
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Fixed the map rotation not being reset if all maps were used but sv_randommaprotation was disabled.

Change Summary

Incremental Difference

diff -r 7227145fbbff -r b5baa0b72f77 src/maprotation.cpp
--- a/src/maprotation.cpp Fri Oct 08 11:02:22 2021 -0400
+++ b/src/maprotation.cpp Sat Oct 09 17:15:44 2021 -0400
@@ -170,36 +170,36 @@
170170 ulPlayerCount++;
171171 }
172172
173+ // If all the maps have been played, make them all available again.
174+ {
175+ bool bAllMapsPlayed = true;
176+ for ( ULONG ulIdx = 0; ulIdx < g_MapRotationEntries.size( ); ulIdx++ )
177+ {
178+ // [AK] Ignore rotation entries that we can't select due to player limits.
179+ if ( MAPROTATION_CanEnterMap( ulIdx, ulPlayerCount ) == false )
180+ continue;
181+
182+ if ( !g_MapRotationEntries[ulIdx].bUsed )
183+ {
184+ bAllMapsPlayed = false;
185+ break;
186+ }
187+ }
188+
189+ if ( bAllMapsPlayed )
190+ {
191+ for ( ULONG ulIdx = 0; ulIdx < g_MapRotationEntries.size( ); ulIdx++ )
192+ g_MapRotationEntries[ulIdx].bUsed = false;
193+
194+ // [AK] If we're the server, tell the clients to reset their map lists too.
195+ if ( NETWORK_GetState( ) == NETSTATE_SERVER )
196+ SERVERCOMMANDS_ResetMapRotation( );
197+ }
198+ }
199+
173200 // [BB] The random selection is only necessary if there is more than one map.
174201 if ( sv_randommaprotation && ( g_MapRotationEntries.size( ) > 1 ) )
175202 {
176- // If all the maps have been played, make them all available again.
177- {
178- bool bAllMapsPlayed = true;
179- for ( ULONG ulIdx = 0; ulIdx < g_MapRotationEntries.size( ); ulIdx++ )
180- {
181- // [AK] Ignore rotation entries that we can't select due to player limits.
182- if ( MAPROTATION_CanEnterMap( ulIdx, ulPlayerCount ) == false )
183- continue;
184-
185- if ( !g_MapRotationEntries[ulIdx].bUsed )
186- {
187- bAllMapsPlayed = false;
188- break;
189- }
190- }
191-
192- if ( bAllMapsPlayed )
193- {
194- for ( ULONG ulIdx = 0; ulIdx < g_MapRotationEntries.size( ); ulIdx++ )
195- g_MapRotationEntries[ulIdx].bUsed = false;
196-
197- // [AK] If we're the server, tell the clients to reset their map lists too.
198- if ( NETWORK_GetState( ) == NETSTATE_SERVER )
199- SERVERCOMMANDS_ResetMapRotation( );
200- }
201- }
202-
203203 // Select a new map.
204204 std::vector<unsigned int> unusedEntries;
205205 for ( unsigned int i = 0; i < g_MapRotationEntries.size( ); ++i )
Show on old repository browser