if (this.killcount != FRAGS_SPECTATOR)
{
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname);
- if(!gameover)
+ if(!game_stopped)
if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2))
Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
this.weaponmodel = "";
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
- if(!this.weaponentities[slot])
- continue; // first load
- this.weaponentities[slot].hook_time = 0;
- this.weaponentities[slot].weaponname = "";
this.weaponentities[slot] = NULL;
}
this.exteriorweaponentity = NULL;
this.oldvelocity = this.velocity;
this.fire_endtime = -1;
this.event_damage = func_null;
+
+ for(int slot = 0; slot < MAX_AXH; ++slot)
+ {
+ entity axh = this.(AuxiliaryXhair[slot]);
+ this.(AuxiliaryXhair[slot]) = NULL;
+
+ if(axh.owner == this && axh != NULL && !wasfreed(axh))
+ delete(axh);
+ }
}
int player_getspecies(entity this)
{
if(teamplay)
{
- string s = Static_Team_ColorName_Lower(player.team);
- if (s != "neutral")
+ switch(player.team)
{
- defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
- defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
+ case NUM_TEAM_1: defaultmodel = autocvar_sv_defaultplayermodel_red; defaultskin = autocvar_sv_defaultplayerskin_red; break;
+ case NUM_TEAM_2: defaultmodel = autocvar_sv_defaultplayermodel_blue; defaultskin = autocvar_sv_defaultplayerskin_blue; break;
+ case NUM_TEAM_3: defaultmodel = autocvar_sv_defaultplayermodel_yellow; defaultskin = autocvar_sv_defaultplayerskin_yellow; break;
+ case NUM_TEAM_4: defaultmodel = autocvar_sv_defaultplayermodel_pink; defaultskin = autocvar_sv_defaultplayerskin_pink; break;
}
}
{
if(teamplay)
{
- string s = Static_Team_ColorName_Lower(player.team);
- if (s != "neutral")
- defaultskin = cvar(strcat("sv_defaultplayerskin_", s));
+ switch(player.team)
+ {
+ case NUM_TEAM_1: defaultskin = autocvar_sv_defaultplayerskin_red; break;
+ case NUM_TEAM_2: defaultskin = autocvar_sv_defaultplayerskin_blue; break;
+ case NUM_TEAM_3: defaultskin = autocvar_sv_defaultplayerskin_yellow; break;
+ case NUM_TEAM_4: defaultskin = autocvar_sv_defaultplayerskin_pink; break;
+ }
}
if(!defaultskin)
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, this);
}
- if (gameover) {
+ if (game_stopped)
TRANSMUTE(Observer, this);
- }
SetSpectatee(this, NULL);
IL_PUSH(g_bot_targets, this);
this.bot_attack = true;
this.monster_attack = true;
+ navigation_dynamicgoal_init(this, false);
PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
+ entity oldwep = this.(weaponentity);
CL_SpawnWeaponentity(this, weaponentity);
+ if(oldwep && oldwep.owner == this)
+ this.(weaponentity).m_gunalign = oldwep.m_gunalign;
}
this.alpha = default_player_alpha;
this.colormod = '1 1 1' * autocvar_g_player_brightness;
this.(weaponentity).cnt = -1;
}
+ MUTATOR_CALLHOOK(PlayerWeaponSelect, this);
+
if (!warmup_stage && !this.alivetime)
this.alivetime = time;
}
void KillIndicator_Think(entity this)
{
- if (gameover)
+ if (game_stopped)
{
this.owner.killindicator = NULL;
delete(this);
float killtime;
float starttime;
- if (gameover)
+ if (game_stopped)
return;
killtime = autocvar_g_balance_kill_delay;
void ClientKill (entity this)
{
- if(gameover) return;
+ if(game_stopped) return;
if(this.player_blocked) return;
if(STAT(FROZEN, this)) return;
if (IS_BOT_CLIENT(this)) PlayerStats_GameReport_AddPlayer(this);
if (autocvar_sv_eventlog)
- GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", this.netname));
+ GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false)));
LogTeamchange(this.playerid, this.team, 1);
stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2))
- if (!g_ca && !g_cts && !g_race) // teamnagger is currently bad for ca, race & cts
+ if(!MUTATOR_CALLHOOK(HideTeamNagger, this))
send_CSQC_teamnagger();
CSQCMODEL_AUTOINIT(this);
sv_notice_join(this);
// update physics stats (players can spawn before physics runs)
+ STAT(MOVEVARS_HIGHSPEED, this) = autocvar_g_movement_highspeed;
+ MUTATOR_CALLHOOK(PlayerPhysics_UpdateStats, this); // do it BEFORE the function so we can modify highspeed!
Physics_UpdateStats(this, PHYS_HIGHSPEED(this));
IL_EACH(g_initforplayer, it.init_for_player, {
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_DISCONNECT, this.netname);
- SetSpectatee(this, NULL);
+ if(IS_SPEC(this))
+ SetSpectatee(this, NULL);
MUTATOR_CALLHOOK(ClientDisconnect, this);
// add a way to see what the items were BEFORE all of these checks for the mutator hook
int items_prev = this.items;
- if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !gameover)
+ if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !game_stopped)
this.modelflags |= MF_ROCKET;
else
this.modelflags &= ~MF_ROCKET;
this.hit_time = spectatee.hit_time;
this.strength_finished = spectatee.strength_finished;
this.invincible_finished = spectatee.invincible_finished;
+ this.superweapons_finished = spectatee.superweapons_finished;
STAT(PRESSED_KEYS, this) = STAT(PRESSED_KEYS, spectatee);
this.weapons = spectatee.weapons;
this.vortex_charge = spectatee.vortex_charge;
this.(weaponentity) = spectatee.(weaponentity);
}
+ for(int slot = 0; slot < MAX_AXH; ++slot)
+ {
+ this.(AuxiliaryXhair[slot]) = spectatee.(AuxiliaryXhair[slot]);
+ }
+
anticheat_spectatecopy(this, spectatee);
this.hud = spectatee.hud;
if(spectatee.vehicle)
if(this.vehicle)
{
- if(!gameover)
+ if(!game_stopped)
{
vehicles_exit(this.vehicle, VHEF_NORMAL);
return;
{
if(!STAT(FROZEN, this))
if(!IS_DEAD(this))
- if(!gameover)
+ if(!game_stopped)
{
entity head, closest_target = NULL;
head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true);
}
if (this.netname != this.netname_previous) {
if (autocvar_sv_eventlog) {
- GameLogEcho(strcat(":name:", ftos(this.playerid), ":", this.netname));
+ GameLogEcho(strcat(":name:", ftos(this.playerid), ":", playername(this, false)));
}
if (this.netname_previous) strunzone(this.netname_previous);
this.netname_previous = strzone(this.netname);
MUTATOR_CALLHOOK(PlayerPreThink, this);
- if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !gameover && !this.vehicle)
+ if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle)
if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this))
{
FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it),
if (IS_PLAYER(this)) {
CheckRules_Player(this);
- if (gameover || intermission_running) {
+ if (game_stopped || intermission_running) {
+ this.modelflags &= ~MF_ROCKET;
if(intermission_running)
IntermissionThink(this);
return;
this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
}
- else if (gameover || intermission_running) {
+ else if (game_stopped || intermission_running) {
if(intermission_running)
IntermissionThink(this);
return;
CheatFrame(this);
//CheckPlayerJump();
- if (gameover)
+ if (game_stopped)
{
this.solid = SOLID_NOT;
this.takedamage = DAMAGE_NO;
CheckRules_Player(this);
UpdateChatBubble(this);
if (this.impulse) ImpulseCommands(this);
- if (gameover)
+ if (game_stopped)
{
CSQCMODEL_AUTOUPDATE(this);
return;