prio = 0;
// filter out spots for the wrong team
- if(teamcheck)
- if(spot.team != teamcheck)
- return '-1 0 0';
+ if(teamcheck >= 0)
+ if(spot.team != teamcheck)
+ return '-1 0 0';
if(race_spawns)
if(spot.target == "")
spotlist = spot;
/*
- if(teamcheck)
+ if(teamcheck >= 0)
if(spot.team != teamcheck)
error("invalid spawn added");
/*
entity e;
- if(teamcheck)
+ if(teamcheck >= 0)
for(e = spotlist; e; e = e.chain)
{
print("seen ", etos(e), "\n");
if (spot)
return spot;
- teamcheck = 0;
-
- if(!anypoint && have_team_spawns > 0)
- teamcheck = self.team;
+ if(anypoint)
+ teamcheck = -1;
+ else if(have_team_spawns > 0)
+ teamcheck = self.team; // MUST be team
+ else if(have_team_spawns == 0 && have_noteam_spawns)
+ teamcheck = 0; // MUST be noteam
+ else
+ teamcheck = -1;
+ // if we get here, we either require team spawns but have none, or we require non-team spawns and have none; use any spawn then
// get the list of players
playerlist = findchain(classname, "player");
print("spot mindistance: ", vtos(spot.spawnpoint_score), "\n");
entity e;
- if(teamcheck)
+ if(teamcheck >= 0)
for(e = firstspot; e; e = e.chain)
if(e.team != teamcheck)
error("invalid spawn found");
playerdemo_init();
anticheat_init();
-
+
race_PreSpawnObserver();
//if(g_domination)
void ReadyCount();
void ClientDisconnect (void)
{
+ if(self.vehicle)
+ {
+ entity oldself;
+ oldself = self;
+ self = self.vehicle;
+ self.vehicle_exit(VHEF_RELESE);
+ self = oldself;
+ }
+
if not(self.flags & FL_CLIENT)
{
print("Warning: ClientDisconnect without ClientConnect\n");
{
// add a way to see what the items were BEFORE all of these checks for the mutator hook
olditems = self.items;
-
+
if((self.items & IT_USING_JETPACK) && !self.deadflag)
{
SoundEntity_StartSound(self, CHAN_PLAYER, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
return;
-
+
Fire_ApplyDamage(self);
Fire_ApplyEffect(self);
if (time < self.spawnshieldtime)
self.effects = self.effects | (EF_ADDITIVE | EF_FULLBRIGHT);
}
-
+
MUTATOR_CALLHOOK(PlayerPowerups);
}
SetZoomState(spectatee.zoomstate);
anticheat_spectatecopy(spectatee);
+
+ //self.vehicle = spectatee.vehicle;
+
+ self.hud = spectatee.hud;
+ if(spectatee.vehicle)
+ {
+ self.vehicle_health = spectatee.vehicle_health;
+ self.vehicle_shield = spectatee.vehicle_shield;
+ self.vehicle_energy = spectatee.vehicle_energy;
+ self.vehicle_ammo1 = spectatee.vehicle_ammo1;
+ self.vehicle_ammo2 = spectatee.vehicle_ammo2;
+ self.vehicle_reload1 = spectatee.vehicle_reload1;
+ self.vehicle_reload2 = spectatee.vehicle_reload2;
+ msg_entity = self;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, spectatee.vehicle.vehicle_viewport);
+ }
}
float SpectateUpdate() {
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, autocvar_g_balance_armor_blockpercent));
-
+
if(self.classname == "player" && self.deadflag == DEAD_NO && autocvar_r_showbboxes)
{
if(!self.showheadshotbbox)