#include "../lib/warpzone/server.qh"
+#include <common/mutators/mutator/overkill/okvortex.qh>
+
STATIC_METHOD(Client, Add, void(Client this, int _team))
{
ClientConnect(this);
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)
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;
.entity weaponentity = weaponentities[slot];
entity oldwep = this.(weaponentity);
CL_SpawnWeaponentity(this, weaponentity);
- if(oldwep)
+ if(oldwep && oldwep.owner == this)
this.(weaponentity).m_gunalign = oldwep.m_gunalign;
}
this.alpha = default_player_alpha;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
.entity weaponentity = weaponentities[slot];
- if(slot == 0)
+ if(slot == 0 || autocvar_g_weaponswitch_debug == 1)
this.(weaponentity).m_switchweapon = w_getbestweapon(this, weaponentity);
else
this.(weaponentity).m_switchweapon = WEP_Null;
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);
this.weapons = spectatee.weapons;
this.vortex_charge = spectatee.vortex_charge;
this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
+ this.okvortex_charge = spectatee.okvortex_charge;
+ this.okvortex_chargepool_ammo = spectatee.okvortex_chargepool_ammo;
this.hagar_load = spectatee.hagar_load;
this.arc_heat_percent = spectatee.arc_heat_percent;
this.minelayer_mines = spectatee.minelayer_mines;
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)
CheckRules_Player(this);
if (game_stopped || intermission_running) {
+ this.modelflags &= ~MF_ROCKET;
if(intermission_running)
IntermissionThink(this);
return;
}
} else {
if (frametime) player_anim(this);
+
+ if (this.respawn_flags & RESPAWN_DENY)
+ {
+ STAT(RESPAWN_TIME, this) = 0;
+ return;
+ }
+
bool button_pressed = (PHYS_INPUT_BUTTON_ATCK(this) || PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_ATCK2(this) || PHYS_INPUT_BUTTON_HOOK(this) || PHYS_INPUT_BUTTON_USE(this));
switch(this.deadflag)
{
.entity weaponentity = weaponentities[slot];
if (WEP_CVAR(vortex, charge_rot_rate) && this.(weaponentity).vortex_charge > WEP_CVAR(vortex, charge_limit) && this.(weaponentity).vortex_charge_rottime < time)
+ {
this.(weaponentity).vortex_charge = bound(WEP_CVAR(vortex, charge_limit), this.(weaponentity).vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
+ }
+ if (WEP_CVAR(okvortex, charge_rot_rate) && this.(weaponentity).okvortex_charge > WEP_CVAR(okvortex, charge_limit) && this.(weaponentity).okvortex_charge_rottime < time)
+ {
+ this.(weaponentity).okvortex_charge = bound(WEP_CVAR(okvortex, charge_limit), this.(weaponentity).okvortex_charge - WEP_CVAR(okvortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
+ }
}
if (frametime) player_anim(this);