using ps.clientNum is not a good idea, try using cl - level.clients or get the entity and subtract that from g_entities or same as ent->s.number.
otherwise can possibly kick someone spectating them instead...
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.
--ryan.
Created attachment 1522[details]
SetTeam fix
Actually, client->ps.clientNum is unsafe. We had a little hunt for this some time ago in Tremulous last year (it caused kick failures, annoying popup windows and other nasty bugs). The problem is that a following spectator gets full copy of client->ps of the followed player including clientNum. If you then try to use this "shared" clientNum, you might affect someone else than you wanted.
r1019 changes are safe as long as bots don't spectate players. However, a brief grep on current code has revealed unsafe client->ps.clientNum usage in SetTeam(). If a following spectator uses team command when forced balance is on, it'll count teams incorrectly and send the error message to the followed player instead. Here's the fix.
Created attachment 1522 [details] SetTeam fix Actually, client->ps.clientNum is unsafe. We had a little hunt for this some time ago in Tremulous last year (it caused kick failures, annoying popup windows and other nasty bugs). The problem is that a following spectator gets full copy of client->ps of the followed player including clientNum. If you then try to use this "shared" clientNum, you might affect someone else than you wanted. r1019 changes are safe as long as bots don't spectate players. However, a brief grep on current code has revealed unsafe client->ps.clientNum usage in SetTeam(). If a following spectator uses team command when forced balance is on, it'll count teams incorrectly and send the error message to the followed player instead. Here's the fix.
Created attachment 1523 [details] SetTeam fix done right this time D'oh, I've left changes which belong somewhere else in the patch...