fix: Prevent players from playing the game as invisible #129
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.
This pull request addresses an issue where players can join as spectator and still act like they were playing in a team.
Any allocator would still provide weapons to the players and they would be able to not only have xray, but to also kill other players while being invisible. The bug would stop happening to that specific player once somebody else could kill that player. This glitch will happen when the player joins and, as I've seen, only happens when the map changes (in the warmup phase).
For that, I changed when we force the player team to address the issue. Changing the team on the 1 second timer is not a problem, as the player takes more than a second to change from the loading screen to the select team screen.
Hope this helps.
This commit has been properly tested and is currently being used in my production servers.
Best Regards,
SpirT