Portal_ClearAll(self);
- Unfreeze(self);
-
if(self.alivetime)
{
if(!warmup_stage)
if(self.killcount != -666)
{
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_QUIT_SPECTATE, self.netname);
+ if(autocvar_g_chat_nospectators == 1 || (cvar("g_warmup") && !(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2))
+ Send_Notification(NOTIF_ONE_ONLY, self, MSG_INFO, INFO_CHAT_NOSPECTATORS);
if(self.just_joined == FALSE) {
LogTeamchange(self.playerid, -1, 4);
self.punchvector = '0 0 0';
self.oldvelocity = self.velocity;
self.fire_endtime = -1;
+ self.event_damage = func_null;
}
.float model_randomizer;
if(teamplay)
{
string s;
- s = Team_ColorName_Lower(self.team);
+ s = Static_Team_ColorName_Lower(self.team);
if(s != "neutral")
{
defaultmodel = cvar_string(strcat("sv_defaultplayermodel_", s));
RemoveGrapplingHook(self); // Wazat's Grappling Hook
+ if(self.vehicle)
+ vehicles_exit(VHEF_RELESE);
+
self.classname = "player";
self.wasplayer = TRUE;
self.iscreature = TRUE;
self.target = s;
activator = world;
self = oldself;
-
- Unfreeze(self);
spawn_spot = spot;
MUTATOR_CALLHOOK(PlayerSpawn);
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
}
{
if(gameover) return;
if(self.player_blocked) return;
- if(self.frozen) return;
+ if(self.freezetag_frozen) return;
ClientKill_TeamChange(0);
}
MUTATOR_CALLHOOK(ClientDisconnect);
Portal_ClearAll(self);
-
- Unfreeze(self);
RemoveGrapplingHook(self);
// 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)
+ if((self.items & IT_USING_JETPACK) && !self.deadflag && !gameover)
self.modelflags |= MF_ROCKET;
else
self.modelflags &= ~MF_ROCKET;
void player_regen (void)
{
- float minh, mina, minf, maxh, maxa, maxf, limith, limita, limitf, max_mod, regen_mod, rot_mod, limit_mod;
- maxh = autocvar_g_balance_health_rotstable;
- maxa = autocvar_g_balance_armor_rotstable;
- maxf = autocvar_g_balance_fuel_rotstable;
- minh = autocvar_g_balance_health_regenstable;
- mina = autocvar_g_balance_armor_regenstable;
- minf = autocvar_g_balance_fuel_regenstable;
- limith = autocvar_g_balance_health_limit;
- limita = autocvar_g_balance_armor_limit;
- limitf = autocvar_g_balance_fuel_limit;
-
- max_mod = regen_mod = rot_mod = limit_mod = 1;
-
- maxh = maxh * max_mod;
- //maxa = maxa * max_mod;
- //maxf = maxf * max_mod;
- minh = minh * max_mod;
- //mina = mina * max_mod;
- //minf = minf * max_mod;
- limith = limith * limit_mod;
- limita = limita * limit_mod;
- //limitf = limitf * limit_mod;
-
- if(g_ca || g_invasion)
- rot_mod = 0;
-
- if (!g_minstagib && !g_ca && !g_invasion && (!g_lms || autocvar_g_lms_regenerate))
+ if(!MUTATOR_CALLHOOK(PlayerRegen))
{
+ float minh, mina, maxh, maxa, limith, limita, max_mod, regen_mod, rot_mod, limit_mod;
+ maxh = autocvar_g_balance_health_rotstable;
+ maxa = autocvar_g_balance_armor_rotstable;
+ minh = autocvar_g_balance_health_regenstable;
+ mina = autocvar_g_balance_armor_regenstable;
+ limith = autocvar_g_balance_health_limit;
+ limita = autocvar_g_balance_armor_limit;
+
+ max_mod = regen_mod = rot_mod = limit_mod = 1;
+
+ maxh = maxh * max_mod;
+ minh = minh * max_mod;
+ limith = limith * limit_mod;
+ limita = limita * limit_mod;
+
self.armorvalue = CalcRotRegen(self.armorvalue, mina, autocvar_g_balance_armor_regen, autocvar_g_balance_armor_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxa, autocvar_g_balance_armor_rot, autocvar_g_balance_armor_rotlinear, rot_mod * frametime * (time > self.pauserotarmor_finished), limita);
self.health = CalcRotRegen(self.health, minh, autocvar_g_balance_health_regen, autocvar_g_balance_health_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished), maxh, autocvar_g_balance_health_rot, autocvar_g_balance_health_rotlinear, rot_mod * frametime * (time > self.pauserothealth_finished), limith);
-
- // if player rotted to death... die!
- if(self.health < 1)
- self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
}
+ // if player rotted to death... die!
+ // check this outside above checks, as player may still be able to rot to death
+ if(self.health < 1)
+ self.event_damage(self, self, 1, DEATH_ROT, self.origin, '0 0 0');
+
if (!(self.items & IT_UNLIMITED_WEAPON_AMMO))
- self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, regen_mod * frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, rot_mod * frametime * (time > self.pauserotfuel_finished), limitf);
+ {
+ float minf, maxf, limitf;
+
+ maxf = autocvar_g_balance_fuel_rotstable;
+ minf = autocvar_g_balance_fuel_regenstable;
+ limitf = autocvar_g_balance_fuel_limit;
+
+ self.ammo_fuel = CalcRotRegen(self.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > self.pauseregen_finished) * ((self.items & IT_FUEL_REGEN) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > self.pauserotfuel_finished), limitf);
+ }
}
float zoomstate_set;
self.dmg_inflictor = spectatee.dmg_inflictor;
self.v_angle = spectatee.v_angle;
self.angles = spectatee.v_angle;
- self.frozen = spectatee.frozen;
- self.revive_progress = spectatee.revive_progress;
if(!self.BUTTON_USE)
self.fixangle = TRUE;
setorigin(self, spectatee.origin);
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);
return;
#endif
- if(self.frozen == 2)
- {
- self.revive_progress = bound(0, self.revive_progress + frametime * self.revive_speed, 1);
- self.health = max(1, self.revive_progress * autocvar_g_balance_health_start);
- self.iceblock.alpha = 1 - self.revive_progress;
-
- if(self.revive_progress >= 1)
- Unfreeze(self);
- }
-
MUTATOR_CALLHOOK(PlayerPreThink);
if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
do_crouch = 0;
if(self.vehicle)
do_crouch = 0;
- if(self.frozen)
+ if(self.freezetag_frozen)
do_crouch = 0;
if(self.weapon == WEP_SHOTGUN && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
do_crouch = 0;
/*
if(g_race)
- dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
+ dprintf("%f %.6f\n", time, race_GetFractionalLapCount(self));
*/
CSQCMODEL_AUTOUPDATE();