void entcs_attach(entity player)
{
- entity e = player.entcs = new(entcs_sender);
+ entity e = CS(player).entcs = new(entcs_sender);
e.owner = player;
setthink(e, entcs_think);
e.nextthink = time;
Net_LinkEntity(e, false, 0, entcs_send);
if (!IS_REAL_CLIENT(player)) return;
FOREACH_CLIENT(true, {
- assert(it.entcs);
- _entcs_send(it.entcs, msg_entity = player, BITS(23), MSG_ONE);
+ assert(CS(it).entcs);
+ _entcs_send(CS(it).entcs, msg_entity = player, BITS(23), MSG_ONE);
});
}
void entcs_detach(entity player)
{
- if (!player.entcs) return;
- delete(player.entcs);
- player.entcs = NULL;
+ if (!CS(player).entcs) return;
+ delete(CS(player).entcs);
+ CS(player).entcs = NULL;
}
#endif
.int m_forceupdate;
/** Force an origin update, for player sounds */
- #define entcs_force_origin(e) ((e).entcs.m_forceupdate = BIT(2))
+ #define entcs_force_origin(e) (CS(e).entcs.m_forceupdate = BIT(2))
#endif
PlayerScore_Detach(this); // what ^they^ said
W_HitPlotClose(this);
ClientData_Detach(this);
+ entcs_detach(this);
delete(CS(this));
this._cs = NULL;
-
bot_clientdisconnect(this);
anticheat_report_to_eventlog(this);
- entcs_detach(this);
}