.string netname_previous;
+void SetSpectator(entity player, entity spectatee);
+
/*
=============
entity spot;
self.hud = HUD_NORMAL;
+ if(IS_PLAYER(self)) { pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); }
+
spot = SelectSpawnPoint (TRUE);
if(!spot)
error("No spawnpoints for observers?!?\n");
if(self.alivetime)
{
if(!warmup_stage)
- PlayerStats_Event(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
+ PS_GR_P_ADDVAL(self, PLAYERSTATS_ALIVETIME, time - self.alivetime);
self.alivetime = 0;
}
self.punchvector = '0 0 0';
self.oldvelocity = self.velocity;
self.fire_endtime = -1;
+ self.event_damage = func_null;
}
.float model_randomizer;
WriteEntity(MSG_ONE, self);
}
+ SetSpectator(self, world);
+
// reset player keys
self.itemkeys = 0;
if(g_weaponarena_random) // WEAPONTODO: more stuff that should be in a mutator. also: rename those cvars
{
- if(g_weaponarena_random_with_laser)
+ if(g_weaponarena_random_with_blaster)
self.weapons &= ~WEPSET_BLASTER;
W_RandomWeapons(self, g_weaponarena_random);
- if(g_weaponarena_random_with_laser)
+ if(g_weaponarena_random_with_blaster)
self.weapons |= WEPSET_BLASTER;
}
self.angles = spot.angles;
self.angles_z = 0; // never spawn tilted even if the spot says to
+ if(IS_BOT_CLIENT(self))
+ self.v_angle = self.angles;
self.fixangle = TRUE; // turn this way immediately
self.velocity = '0 0 0';
self.avelocity = '0 0 0';
self.spider_slowness = 0;
- self.statdraintime = time + 5;
self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
if(self.killcount == -666) {
if(self.killindicator_teamchange)
ClientKill_Now_TeamChange();
- // in any case:
- Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
+ if(IS_PLAYER(self))
+ Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0');
// now I am sure the player IS dead
}
stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
if(autocvar_sv_gentle)
stuffcmd(e, "cl_cmd settemp cl_gentle 1\n");
- /*
- * we no longer need to stuff this. Remove this comment block if you feel
- * 2.3 and higher (or was it 2.2.3?) don't need these any more
- stuffcmd(e, strcat("cl_gravity ", ftos(autocvar_sv_gravity), "\n"));
- stuffcmd(e, strcat("cl_movement_accelerate ", ftos(autocvar_sv_accelerate), "\n"));
- stuffcmd(e, strcat("cl_movement_friction ", ftos(autocvar_sv_friction), "\n"));
- stuffcmd(e, strcat("cl_movement_maxspeed ", ftos(autocvar_sv_maxspeed), "\n"));
- stuffcmd(e, strcat("cl_movement_airaccelerate ", ftos(autocvar_sv_airaccelerate), "\n"));
- stuffcmd(e, strcat("cl_movement_maxairspeed ", ftos(autocvar_sv_maxairspeed), "\n"));
- stuffcmd(e, strcat("cl_movement_stopspeed ", ftos(autocvar_sv_stopspeed), "\n"));
- stuffcmd(e, strcat("cl_movement_jumpvelocity ", ftos(autocvar_sv_jumpvelocity), "\n"));
- stuffcmd(e, strcat("cl_movement_stepheight ", ftos(autocvar_sv_stepheight), "\n"));
- stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(autocvar_sv_friction_on_land), "\n"));
- stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(autocvar_sv_airaccel_qw), "\n"));
- stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(autocvar_sv_airaccel_sideways_friction), "\n"));
- stuffcmd(e, "cl_movement_edgefriction 1\n");
- */
}
float PlayerInIDList(entity p, string idlist)
player_count = 0;
}
+ if(IS_REAL_CLIENT(self)) { PlayerStats_PlayerBasic_CheckUpdate(self); }
+
PlayerScore_Attach(self);
ClientData_Attach();
accuracy_init(self);
self.playerid = (playerid_last = playerid_last + 1);
- PlayerStats_AddEvent(sprintf("kills-%d", self.playerid));
+ PlayerStats_GameReport_AddEvent(sprintf("kills-%d", self.playerid));
if(IS_BOT_CLIENT(self))
- PlayerStats_AddPlayer(self);
+ PlayerStats_GameReport_AddPlayer(self);
if(autocvar_sv_eventlog)
GameLogEcho(strcat(":join:", ftos(self.playerid), ":", ftos(num_for_edict(self)), ":", ((IS_REAL_CLIENT(self)) ? self.netaddress : "bot"), ":", self.netname));
return;
}
- PlayerStats_AddGlobalInfo(self);
+ PlayerStats_GameReport_FinalizePlayer(self);
+
+ if(IS_PLAYER(self)) { pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); }
CheatShutdownClient();
Fire_ApplyDamage(self);
Fire_ApplyEffect(self);
- if (!g_minstagib)
+ if (!g_instagib)
{
if (self.items & IT_STRENGTH)
{
self.vortex_charge = spectatee.vortex_charge;
self.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
self.hagar_load = spectatee.hagar_load;
+ self.arc_heat_percent = spectatee.arc_heat_percent;
self.minelayer_mines = spectatee.minelayer_mines;
self.punchangle = spectatee.punchangle;
self.view_ofs = spectatee.view_ofs;
}
}
-float SpectateUpdate() {
+float SpectateUpdate()
+{
if(!self.enemy)
return 0;
- if (self == self.enemy)
- return 0;
-
- if (!IS_PLAYER(self.enemy))
+ if(!IS_PLAYER(self.enemy) || self == self.enemy)
+ {
+ SetSpectator(self, world);
return 0;
+ }
SpectateCopy(self.enemy);
return TRUE;
}
+void SetSpectator(entity player, entity spectatee)
+{
+ entity old_spectatee = player.enemy;
+
+ player.enemy = spectatee;
+
+ // WEAPONTODO
+ // these are required to fix the spectator bug with arc
+ if(old_spectatee && old_spectatee.arc_beam) { old_spectatee.arc_beam.SendFlags |= ARC_SF_SETTINGS; }
+ if(player.enemy && player.enemy.arc_beam) { player.enemy.arc_beam.SendFlags |= ARC_SF_SETTINGS; }
+}
+
float Spectate(entity pl)
{
if(g_ca && !autocvar_g_ca_spectate_enemies && self.caplayer)
if(pl.team != self.team)
return 0;
- self.enemy = pl;
+ SetSpectator(self, pl);
return SpectateSet();
}
other = find(other, classname, "player");
}
- if (other)
- self.enemy = other;
+ if(other) { SetSpectator(self, other); }
return SpectateSet();
}
else
other = first;
}
- self.enemy = other;
+ SetSpectator(self, other);
return SpectateSet();
}
float currentlyPlaying = 0;
FOR_EACH_REALCLIENT(e)
- if(IS_PLAYER(e) || e.caplayer == 1)
+ if(IS_PLAYER(e) || e.caplayer)
currentlyPlaying += 1;
if(currentlyPlaying < autocvar_g_maxplayers)
* g_maxplayers_spectator_blocktime seconds
*/
void checkSpectatorBlock() {
- if(IS_SPEC(self) || IS_OBSERVER(self)) {
+ if(IS_SPEC(self) || IS_OBSERVER(self))
+ if(!self.caplayer)
+ if(IS_REAL_CLIENT(self))
+ {
if( time > (self.spectatortime + autocvar_g_maxplayers_spectator_blocktime) ) {
Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_QUIT_KICK_SPECTATING);
dropclient(self);
self.stat_game_starttime = game_starttime;
self.stat_round_starttime = round_starttime;
- self.stat_allow_oldnexbeam = autocvar_g_allow_oldnexbeam;
+ self.stat_allow_oldvortexbeam = autocvar_g_allow_oldvortexbeam;
self.stat_leadlimit = autocvar_leadlimit;
if(frametime)
player_regen();
// WEAPONTODO: Add a weapon request for this
- // rot nex charge to the charge limit
+ // rot vortex charge to the charge limit
if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);