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 if (ps.m_client != this) return; // don't own state, spectator
20 ps.m_switchweapon = WEP_Null;
21 ps.m_weapon = WEP_Null;
22 ps.m_switchingweapon = WEP_Null;
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 // TODO: fold all of these into ClientState
50 DecodeLevelParms(this);
52 PlayerScore_Attach(this);
53 PlayerStats_PlayerBasic_CheckUpdate(this);
54 ClientData_Attach(this);
57 playerdemo_init(this);
61 bot_clientconnect(this);
64 void bot_clientdisconnect(entity this);
65 void W_HitPlotClose(entity this);
66 void anticheat_report(entity this);
67 void playerdemo_shutdown(entity this);
68 void entcs_detach(entity this);
69 void accuracy_free(entity this);
70 void ClientData_Detach(entity this);
71 void PlayerScore_Detach(entity this);
73 void ClientState_detach(entity this)
78 GetCvars(this, -1); // free cvars
80 bot_clientdisconnect(this);
83 anticheat_report(this);
84 playerdemo_shutdown(this);
87 ClientData_Detach(this);
88 PlayerScore_Detach(this);