X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=b09657e6a5832d8b93bae23b537daaa26fe6946e;hb=669311cae7c93d70ff08fa2e3dd30cabdd2da8fa;hp=0df94e0555720d729d40123ab5f5a2e2f6e05e2a;hpb=ffcd91a9e24de4a1f3462825cd9e9903e0ecd24b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 0df94e055..b09657e6a 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -89,8 +89,7 @@ bool TeamScore_SendEntity(entity this, entity to, float sendflags) void TeamScore_Spawn(float t, string name) { - entity ts = new(csqc_score_team); - make_pure(ts); + entity ts = new_pure(csqc_score_team); ts.netname = name; // not used yet, FIXME ts.team = t; Net_LinkEntity(ts, false, 0, TeamScore_SendEntity); @@ -212,8 +211,7 @@ void ScoreInfo_Init(float teams) } else { - scores_initialized = new(ent_client_scoreinfo); - make_pure(scores_initialized); + scores_initialized = new_pure(ent_client_scoreinfo); Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity); } if(teams >= 1) @@ -285,32 +283,32 @@ float PlayerScore_Clear(entity player) void Score_ClearAll() { - entity p, sk; - float i, t; - FOR_EACH_CLIENTSLOT(p) + entity sk; + float t; + FOREACH_CLIENTSLOT(true, { - sk = p.scorekeeper; + sk = it.scorekeeper; if(!sk) continue; - for(i = 0; i < MAX_SCORE; ++i) + for(int j = 0; j < MAX_SCORE; ++j) { - if(sk.(scores[i]) != 0) - if(scores_label[i] != "") - sk.SendFlags |= pow(2, i); - sk.(scores[i]) = 0; + if(sk.(scores[j]) != 0) + if(scores_label[j] != "") + sk.SendFlags |= pow(2, j); + sk.(scores[j]) = 0; } - } + }); for(t = 0; t < 16; ++t) { sk = teamscorekeepers[t]; if(!sk) continue; - for(i = 0; i < MAX_TEAMSCORE; ++i) + for(int j = 0; j < MAX_TEAMSCORE; ++j) { - if(sk.(teamscores[i]) != 0) - if(teamscores_label[i] != "") - sk.SendFlags |= pow(2, i); - sk.(teamscores[i]) = 0; + if(sk.(teamscores[j]) != 0) + if(teamscores_label[j] != "") + sk.SendFlags |= pow(2, j); + sk.(teamscores[j]) = 0; } } } @@ -319,8 +317,7 @@ void PlayerScore_Attach(entity player) { if(player.scorekeeper) error("player already has a scorekeeper"); - entity sk = new(scorekeeper); - make_pure(sk); + entity sk = new_pure(scorekeeper); sk.owner = player; Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity); player.scorekeeper = sk; @@ -349,7 +346,7 @@ float PlayerScore_Add(entity player, float scorefield, float score) { if(gameover) return 0; - backtrace("Adding score to unknown player!"); + LOG_WARNING("Adding score to unknown player!"); return 0; } if(score) @@ -390,6 +387,7 @@ float PlayerScore_Compare(entity t1, entity t2, float strict) void WinningConditionHelper() { + SELFPARAM(); float c; string s; float fullstatus; @@ -706,15 +704,15 @@ entity PlayerScore_Sort(.float field, float teams, float strict, float nospectat FOREACH_CLIENT(true, LAMBDA(it.(field) = 0)); - FOR_EACH_CLIENT(p) if(p.scorekeeper) + FOREACH_CLIENT(it.scorekeeper, { if(nospectators) - if(p.frags == FRAGS_SPECTATOR) + if(it.frags == FRAGS_SPECTATOR) continue; - p.chain = plist; - plist = p; - } + it.chain = plist; + plist = it; + }); // Now plist points to the whole list. pfirst = plast = world;