Called every frame for each client after the physics are run
=============
*/
-.float idlekick_lasttimeleft;
void PlayerPostThink (entity this)
{
Player_Physics(this);
{ /* do nothing */ }
else if (time - CS(this).parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10
{
- if (this.idlekick_lasttimeleft)
+ if (CS(this).idlekick_lasttimeleft)
{
- this.idlekick_lasttimeleft = 0;
+ CS(this).idlekick_lasttimeleft = 0;
Kill_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CPID_IDLING);
}
}
{
float timeleft = ceil(sv_maxidle - (time - CS(this).parm_idlesince));
if (timeleft == min(10, sv_maxidle - 1)) { // - 1 to support sv_maxidle <= 10
- if (!this.idlekick_lasttimeleft)
+ if (!CS(this).idlekick_lasttimeleft)
Send_Notification(NOTIF_ONE_ONLY, this, MSG_CENTER, CENTER_DISCONNECT_IDLING, timeleft);
}
if (timeleft <= 0) {
return;
}
else if (timeleft <= 10) {
- if (timeleft != this.idlekick_lasttimeleft) {
+ if (timeleft != CS(this).idlekick_lasttimeleft) {
Send_Notification(NOTIF_ONE, this, MSG_ANNCE, Announcer_PickNumber(CNT_IDLE, timeleft));
}
- this.idlekick_lasttimeleft = timeleft;
+ CS(this).idlekick_lasttimeleft = timeleft;
}
}
}
ATTRIB(Client, parm_idlesince, int, this.parm_idlesince);
ATTRIB(Client, muted, bool, this.muted);
ATTRIB(Client, killindicator_teamchange, int, this.killindicator_teamchange);
+ ATTRIB(Client, idlekick_lasttimeleft, float, this.idlekick_lasttimeleft);
METHOD(Client, m_unwind, bool(Client this));