3 void Inventory_new(entity this);
4 void Inventory_delete(entity this);
6 void PlayerState_attach(entity this)
8 this._ps = NEW(PlayerState, this);
13 void PlayerState_detach(entity this)
15 PlayerState ps = PS(this);
16 if (!ps) return; // initial connect
19 ps.m_switchweapon = WEP_Null;
20 ps.m_weapon = WEP_Null;
21 ps.m_switchingweapon = WEP_Null;
24 if (ps.m_client != this) return; // don't own state, spectator
25 FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
28 Inventory_delete(this);
31 void GetCvars(entity this, int);
32 void DecodeLevelParms(entity this);
33 void PlayerScore_Attach(entity this);
34 void ClientData_Attach(entity this);
35 void accuracy_init(entity this);
36 void entcs_attach(entity this);
37 void playerdemo_init(entity this);
38 void anticheat_init(entity this);
39 void W_HitPlotOpen(entity this);
40 void bot_clientconnect(entity this);
42 void ClientState_attach(entity this)
44 this._cs = NEW(ClientState, this);
46 GetCvars(this, 0); // get other cvars from player
48 if (IS_REAL_CLIENT(this)) { PlayerStats_PlayerBasic_CheckUpdate(this); }
50 // TODO: fold all of these into ClientState
52 DecodeLevelParms(this);
54 PlayerScore_Attach(this);
55 ClientData_Attach(this);
58 playerdemo_init(this);
62 bot_clientconnect(this);
65 void bot_clientdisconnect(entity this);
66 void W_HitPlotClose(entity this);
67 void anticheat_report(entity this);
68 void playerdemo_shutdown(entity this);
69 void entcs_detach(entity this);
70 void accuracy_free(entity this);
71 void ClientData_Detach(entity this);
72 void PlayerScore_Detach(entity this);
74 void ClientState_detach(entity this)
79 GetCvars(this, -1); // free cvars
81 bot_clientdisconnect(this);
84 anticheat_report(this);
85 playerdemo_shutdown(this);
88 ClientData_Detach(this);
89 PlayerScore_Detach(this);