[fixed] Queue button doesn't turn grey when other player changes team #2010
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Description
Fixes #1528
This PR changes code in
SpectatorQueue.as
to fix a bug where the queue button in the top right corner turns grey whenever a different player changes teams. The culprit is the lineclient_selected = -99;
inonPlayerChangedTeam()
.Since the
newteam == this.getSpectatorTeamNum()
check and theoldteam != this.getSpectatorTeamNum() && player.isMyPlayer()
check are basicly the same (player changes from red/blue team to spectator), I mixed both code blocks and also moved the lineclient_selected = -99;
inside it.SetupQueueGUI(this);
also should only run ifplayer.isMyPlayer()
is true.I tested in a dedicated CTF server with bots. Although the queue logic doesn't work well with bots, when there are enough bots it is possible to queue for one team without instantly entering it, allowing me to test the bug scenario. When queuing for a team and having a bot player change its team, my button previously turned grey but after applying the above fix it doesn't.
The sound for successfully getting entered into a team will still play at the correct time.
It plays only when switching from spectator to red/blue via the queue.