Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapchooser: Fix previous map exclusion bug #1197

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

stickz
Copy link
Contributor

@stickz stickz commented Mar 1, 2020

This commit fixes a bug where if the value of sm_mapvote_exclude is reduced, the change may not take effect for an extended period of time. The size of the old map list is not updated when this happens.

This commit fixes a bug where if the value of `sm_mapvote_exclude` is reduced, the change may not take effect right away.
@KyleSanderson KyleSanderson merged commit 287628b into alliedmodders:master Jul 9, 2020
@KyleSanderson
Copy link
Member

Interesting catch, thanks!

@@ -260,7 +260,7 @@ public void OnMapEnd()
RemoveStringFromArray(g_OldMapList, map);
g_OldMapList.PushString(map);

if (g_OldMapList.Length > g_Cvar_ExcludeMaps.IntValue)
while (g_OldMapList.Length > g_Cvar_ExcludeMaps.IntValue)
{
g_OldMapList.Erase(0);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better do something like this?

if ( g_OldMapList.Length > g_Cvar_ExcludeMaps.IntValue )
{
	g_OldMapList.Resize( Cvar_ExcludeMaps.IntValue );
}	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants