3 void Inventory_new(PlayerState this);
4 void Inventory_delete(entity this);
6 void PlayerState_attach(entity this)
8 this._ps = NEW(PlayerState, this);
10 Inventory_new(PS(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
23 FOREACH_CLIENT(PS(it) == ps, { PS(it) = NULL; });
27 void GetCvars(entity this, entity store, int);
28 void DecodeLevelParms(entity this);
29 void PlayerScore_Attach(entity this);
30 void ClientData_Attach(entity this);
31 void accuracy_init(entity this);
32 void entcs_attach(entity this);
33 void anticheat_init(entity this);
34 void W_HitPlotOpen(entity this);
35 void bot_clientconnect(entity this);
37 void ClientState_attach(entity this)
39 this._cs = NEW(ClientState, this);
41 GetCvars(this, CS(this), 0); // get other cvars from player
43 // TODO: fold all of these into ClientState
45 DecodeLevelParms(this);
47 PlayerScore_Attach(this);
48 PlayerStats_PlayerBasic_CheckUpdate(this);
49 ClientData_Attach(this);
56 void bot_clientdisconnect(entity this);
57 void W_HitPlotClose(entity this);
58 void anticheat_report_to_eventlog(entity this);
59 void entcs_detach(entity this);
60 void accuracy_free(entity this);
61 void ClientData_Detach(entity this);
62 void PlayerScore_Detach(entity this);
64 void ClientState_detach(entity this)
66 GetCvars(this, CS(this), -1); // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
67 accuracy_free(this); // TODO: needs to be before CS() is deleted!
68 PlayerScore_Detach(this); // what ^they^ said
70 ClientData_Detach(this);
75 bot_clientdisconnect(this);
77 anticheat_report_to_eventlog(this);