if((p.playerstats_id == "") || PS_GR_OUT_DB < 0) { return; }
// add global info!
- if(p.alivetime)
+ if(p.alivetime_start)
{
- PlayerStats_GameReport_Event_Player(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
- p.alivetime = 0;
+ PlayerStats_GameReport_Event_Player(p, PLAYERSTATS_ALIVETIME, max(0, time - p.alivetime_start));
+ p.alivetime_start = 0;
}
db_put(PS_GR_OUT_DB, sprintf("%s:_playerid", p.playerstats_id), ftos(p.playerid));
Portal_ClearAll(this);
SetSpectatee(this, NULL);
- if (this.alivetime)
+ if (this.alivetime_start)
{
if (!warmup_stage)
- PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, time - this.alivetime);
- this.alivetime = 0;
+ PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, max(0, time - this.alivetime_start));
+ this.alivetime_start = 0;
}
if (this.vehicle) vehicles_exit(this.vehicle, VHEF_RELEASE);
W_WeaponFrame(this, weaponentity);
}
- if (!warmup_stage && !this.alivetime)
- this.alivetime = time;
+ if (!warmup_stage && !this.alivetime_start)
+ this.alivetime_start = max(time, game_starttime);
antilag_clear(this, CS(this));
.float jointime; // time of connecting
.float startplaytime; // time of switching from spectator to player
-.float alivetime; // time of being alive
+.float alivetime_start; // start time of being alive
.float death_time;
.bool wasplayer;
// clear player attributes
FOREACH_CLIENT(IS_PLAYER(it), {
- it.alivetime = 0;
+ it.alivetime_start = 0;
CS(it).killcount = 0;
});
{
bool defer_ClientKill_Now_TeamChange = false;
- if(this.alivetime)
+ if(this.alivetime_start)
{
- PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, time - this.alivetime);
- this.alivetime = 0;
+ PlayerStats_GameReport_Event_Player(this, PLAYERSTATS_ALIVETIME, max(0, time - this.alivetime_start));
+ this.alivetime_start = 0;
}
if(valid_damage_for_weaponstats)