ATTRIB(Client, model_randomizer, float, this.model_randomizer);
ATTRIB(Client, accuracy, entity, this.accuracy);
ATTRIB(Client, hasweapon_complain_spam, float, this.hasweapon_complain_spam);
+ ATTRIB(Client, scorekeeper, entity, this.scorekeeper);
METHOD(Client, m_unwind, bool(Client this));
if(MUTATOR_CALLHOOK(ForbidPlayerScore_Clear)) return 0;
- sk = player.scorekeeper;
+ sk = CS(player).scorekeeper;
FOREACH(Scores, true, {
if(sk.(scores(it)) != 0)
if(scores_label(it) != "")
entity sk;
float t;
FOREACH_CLIENTSLOT(true, {
- sk = it.scorekeeper;
+ sk = CS(it).scorekeeper;
if (!sk) continue;
FOREACH(Scores, true, {
if(sk.(scores(it)) != 0)
void PlayerScore_Attach(entity player)
{
- if(player.scorekeeper)
+ if(CS(player).scorekeeper)
error("player already has a scorekeeper");
entity sk = new_pure(scorekeeper);
sk.owner = player;
Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity);
- player.scorekeeper = sk;
+ CS(player).scorekeeper = sk;
}
void PlayerScore_Detach(entity player)
{
- if(!player.scorekeeper)
+ if(!CS(player).scorekeeper)
error("player has no scorekeeper");
- delete(player.scorekeeper);
- player.scorekeeper = NULL;
+ delete(CS(player).scorekeeper);
+ CS(player).scorekeeper = NULL;
}
float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score)
score = 0;
if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
- entity s = player.scorekeeper;
+ entity s = CS(player).scorekeeper;
if(!s)
{
if(game_stopped)
winnerscorekeeper = NULL;
secondscorekeeper = NULL;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
- sk = it.scorekeeper;
+ sk = CS(it).scorekeeper;
c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
if(c < 0)
{
});
out = substring(out, 0, strlen(out) - 1);
}
- else if((sk = pl.scorekeeper))
+ else if((sk = CS(pl).scorekeeper))
{
FOREACH(Scores, true, {
if ((scores_flags(it) & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
return 0;
}
- return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
+ return PlayerScore_Compare(CS(p1).scorekeeper, CS(p2).scorekeeper, strict);
}
entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators)
FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
- FOREACH_CLIENT(it.scorekeeper,
+ FOREACH_CLIENT(CS(it).scorekeeper,
{
if(nospectators)
if(it.frags == FRAGS_SPECTATOR)
float fl, sc;
s = " ";
- sk = p.scorekeeper;
+ sk = CS(p).scorekeeper;
s = strcat(s, playername(p, false));
for (;;)
void PlayerScore_PlayerStats(entity p)
{
- entity s = p.scorekeeper;
+ entity s = CS(p).scorekeeper;
FOREACH(Scores, true, {
if(s.(scores(it)) != 0)
if(scores_label(it) != "")