Commit graph

10 commits

Author SHA1 Message Date
Zack Middleton
f7c3276fe8 Fix g_teamAutoJoin and g_teamForceBalance
There are various issues caused by not knowing the initial team for
the local client and bots when they connect. This is can be reproduced
by starting a team game from the main menu.

When g_teamAutoJoin is enabled, bots and local client join a random
team at connect and then execute their team command a few frames
later. This may result in the player being killed if they specify a
different team. In Team Arena's Harvester mode this causes harvester
skulls to be spawned at the beginning of the game.

When g_teamForceBalance is enabled, the local client and bots may not
be able to join their desired team. This may result in them being
spectators. If g_teamAutoJoin is also enabled they may be left on
the opposite (red/blue) team they were meant to join.

There is a hack for including bot's team in their player info string
(used by cgame for which team skin to use) before the bot joins
their desired team. Bots aren't guaranteed to join their desired team
(as may happen when both g_teamAutoJoin and g_teamForceBalance are
enabled) so clients may see them as being on the wrong team!

----

Add teampref userinfo option for team preference. If teampref is set
it will be used for attempting to join the team immediately at connect.

Bots now join team at connect using teampref userinfo. So remove
the hack for setting bot's team in player info string before the bot
joins the team.

To avoid the client sending teampref userinfo to all network servers,
the local client uses a g_localTeamPref cvar. The g_localTeamPref
cvar is cleared after it's used so it doesn't get used when starting
another server later. Another reason not to use a teampref userinfo
cvar is there isn't a reliable way to clear it in CGame/UI which are
likely loaded from baseq3 pk3.

Make it so g_teamAutoJoin doesn't affect clients who specify
teampref. If teampref is invalid, the client will join a random team
like g_teamAutoJoin.

Don't apply g_teamForceBalance to the local client or bots. Otherwise
they may be left as spectators when starting team game from menu.

The start server menus use team command and g_localTeamPref to set
the human player's team. This way it's compatible with vanilla Q3
game VMs and the new setting team at connect feature.
2017-06-22 21:56:20 -05:00
Zack Middleton
56ebe14239 Don't have g_teamAutoJoin affect bot's team
Bots set their team later, setting it here causes some bots to change team and die later. Can cause extra skulls to be spawn at beginning of harvester (bug #5740).
2012-09-08 22:32:41 +00:00
Thilo Schulz
31ec563999 Fix player queueing for tournament play (#4939) 2011-04-07 23:41:32 +00:00
Tim Angus
672cfbf16f * Merge unified-sdl to trunk
* Bump Q3_VERSION to 1.35
2007-09-05 18:17:46 +00:00
Ludwig Nussel
8e82c3d605 - tag more functions with gnu format attribute
- fix format string bugs. still some left
2006-12-30 12:32:54 +00:00
Tim Angus
05e8ab9538 * Added STATUS
* Updated TODO
* Moved ChangeLog to root
* Updated ChangeLog
* s/Foobar/Quake III Arena Source Code/
* Biggest patch EVAR. I wonder how many mail boxes this will fill...
2005-10-29 01:53:09 +00:00
Ludwig Nussel
5ae70d54b0 remove svn:executable property 2005-08-28 17:54:51 +00:00
Zachary Slater
59cce31e75 newlines fixed 2005-08-26 17:39:27 +00:00
Zachary Slater
5b755058f5 Itsa me, quake3io! 2005-08-26 04:48:05 +00:00
Travis Bradshaw
dbe4ddb103 The Quake III Arena sources as originally released under the GPL license on August 20, 2005. 2012-01-31 13:41:34 -06:00