entity nagger;
float readycount;
+
float Nagger_SendEntity(entity to, float sendflags)
{
float nags, i, f, b;
entity e;
WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
+ // bits:
+ // 1 = ready
+ // 2 = player needs to ready up
+ // 4 = vote
+ // 8 = player needs to vote
+ // 16 = warmup
+ // sendflags:
+ // 64 = vote counts
+ // 128 = vote string
+
nags = 0;
if(readycount)
{
if(inWarmupStage)
nags |= 16;
+ if(sendflags & 64)
+ nags |= 64;
+
if(sendflags & 128)
nags |= 128;
+ if(!(nags & 4)) // no vote called? send no string
+ nags &~= (64 | 128);
+
WriteByte(MSG_ENTITY, nags);
- if(nags & 128)
+ if(nags & 64)
{
- WriteString(MSG_ENTITY, votecalledvote_display);
+ WriteByte(MSG_ENTITY, vote_yescount);
+ WriteByte(MSG_ENTITY, vote_nocount);
+ WriteByte(MSG_ENTITY, vote_needed_absolute);
+ WriteChar(MSG_ENTITY, to.vote_vote);
}
+ if(nags & 128)
+ WriteString(MSG_ENTITY, votecalledvote_display);
+
if(nags & 1)
{
for(i = 1; i <= maxclients; i += 8)
void Nagger_VoteCountChanged()
{
if(nagger)
- nagger.SendFlags |= 1;
+ nagger.SendFlags |= 64;
}
void Nagger_ReadyCounted()
{
ClientKill_TeamChange(-2); // observe
} else if(autocvar_g_campaign || autocvar_g_balance_teams || autocvar_g_balance_teams_force) {
//JoinBestTeam(self, FALSE, TRUE);
- } else if(teams_matter && !autocvar_sv_spectate && !(self.team_forced > 0)) {
+ } else if(teamplay && !autocvar_sv_spectate && !(self.team_forced > 0)) {
self.classname = "observer";
stuffcmd(self,"menu_showteamselect\n");
}
if(self.classname == "player" && autocvar_sv_spectate == 1) {
ClientKill_TeamChange(-2); // observe
}
+ if(g_ca && self.caplayer && (self.classname == "spectator" || self.classname == "observer")) {
+ // in CA, allow a dead player to move to spectatators (without that, caplayer!=0 will be moved back to the player list)
+ sprint(self, "WARNING: you will spectate in the next round.\n");
+ self.caplayer = 0;
+ }
} else if(cmd == "join") {
if not(self.flags & FL_CLIENT)
return;
}
else {
//player may not join because of g_maxplayers is set
- centerprint_atprio(self, CENTERPRIO_MAPVOTE, PREVENT_JOIN_TEXT);
+ centerprint(self, PREVENT_JOIN_TEXT);
}
}
} else if( cmd == "selectteam" ) {
if not(self.flags & FL_CLIENT)
return;
- if( !teams_matter ) {
+ if( !teamplay ) {
sprint( self, "selectteam can only be used in teamgames\n");
} else if(autocvar_g_campaign) {
//JoinBestTeam(self, 0);
readycount = 0;
Nagger_ReadyCounted(); // NOTE: this causes a resend of that entity, and will also turn off warmup state on the client
- if(autocvar_teamplay_lockonrestart && teams_matter) {
+ if(autocvar_teamplay_lockonrestart && teamplay) {
lockteams = 1;
bprint("^1The teams are now locked.\n");
}