Teamplay fixes and improvements
I've greatly improved teamplay functions. Let's start with hooks.
Player_ChangeTeamnow can prevent player from changing teams.
GetTeamCount- can be used to override team counts.
FindBestTeams- returns the bitmask of the best teams for a player. Can be used to implement custom team balance.
Player_ChangedTeam- called after player has changed their team. Useful to keep track of player teams.
Player_ChangeTeamKill- can be used to allow player to change their team without killing themselves.
ClientKill_Now- can be used stop player from killing themselves right before that moment. This is more useful than
Finally, some internal changes:
- I've added
Player_ChangedTeamand modified other teamplay parts to use this function. The goal is to always keep track of player team which is critical to my mod.
- I've split
IsTeamEqualToTeam. And I've changed the algorithm not to count bots so people can join teams that they weren't able before. This is complemented by
AutoBalanceBotswhich will swap player with bot and will keep teams balanced.
- I've added
FindBestTeamswhich returns bitmask of the best team for the player. Can be more useful than
lowestbotteamX. Useful for better team balance.
- Substantially rewritten