fix(gsc): team balance (#515)

This commit is contained in:
Edo 2022-11-02 14:09:51 +00:00 committed by GitHub
parent ad371d351a
commit 15c31e6cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,23 @@
init()
{
// define onteamselection callback function used in balanceteams()
level.onteamselection = ::set_team;
}
set_team(team)
{
if (team != self.pers["team"])
{
self.switching_teams = true;
self.joining_team = team;
self.leaving_team = self.pers["team"];
}
if (self.sessionstate == "playing")
{
self suicide();
}
maps\mp\gametypes\_menus::addtoteam(team);
maps\mp\gametypes\_menus::endrespawnnotify();
}