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

Queue puts you as waiting to join "any team" when waiting to join a certain team #1528

Open
mugg91 opened this issue Dec 2, 2022 · 3 comments · May be fixed by #2010
Open

Queue puts you as waiting to join "any team" when waiting to join a certain team #1528

mugg91 opened this issue Dec 2, 2022 · 3 comments · May be fixed by #2010
Labels
bug An *objective* unintended feature/mechanic that should be fixed

Comments

@mugg91
Copy link
Contributor

mugg91 commented Dec 2, 2022

Description

  1. As spectator, click "join red team" or "join blue team".
  2. Notice that sometimes you will get put as waiting to join "any team".

Reproduction

Video - https://www.youtube.com/watch?v=qTy_kL6UCN0

@eps0003 eps0003 added the bug An *objective* unintended feature/mechanic that should be fixed label Dec 2, 2022
@mugg91
Copy link
Contributor Author

mugg91 commented Dec 7, 2022

It seems the problem is only graphical.

  1. It's 4 blue players, 6 red players, I queue as "waiting to join red team"
  2. The button turns grey.
  3. It still correctly joins me into red team when a slot becomes available.

The issue itself, I have seen happening after another player becomes spectator.
Not sure if it starts happening because player limit is exceeded by patreon players...

@asumagic
Copy link
Member

@bunniewormy ping, I missed that issue.

@mugg91
Copy link
Contributor Author

mugg91 commented Mar 26, 2024

In SpectatorQueue.as:

void onPlayerChangedTeam(CRules@ this, CPlayer@ player, u8 oldteam, u8 newteam)
{
	if (newteam == this.getSpectatorTeamNum())
	{
		SetupQueueGUI(this);
	}

	if (oldteam != this.getSpectatorTeamNum() && player.isMyPlayer()) 
	{
		hide = true;
		return;
	}

	if (this.get_bool(player.getUsername() + "_playsound"))
	{
		if (isClient() && player.isMyPlayer())
		{
			Sound::Play("AchievementUnlocked.ogg"); // TODO: different, distinct sound
		}

		this.set_bool(player.getUsername() + "_playsound", false);
	}

	client_selected = -99;
	RemoveFromQueue(player);
}

I think the line client_selected = -99; is the cause of the problem, making your button grey when someone before you switched teams. Maybe the issue is fixed by moving the line into the if (oldteam != this.getSpectatorTeamNum() && player.isMyPlayer()) code block. But I'm currently unable to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An *objective* unintended feature/mechanic that should be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants