X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fscores.qc;h=678baec958aa26d313a297959947fde5cbd5cac3;hb=c53eefe3c0c96fb03d404a32ae9f952e2308ec05;hp=57f5e95f8fd6878951ac9d42e5ce79c7ba1dcbd2;hpb=1bc3ab0285f65c7ed0c75cbba00da2460921c973;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index 57f5e95f8..678baec95 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -1,8 +1,7 @@ #include "scores.qh" -#include "_all.qh" #include "command/common.qh" -#include "mutators/mutators_include.qh" +#include "mutators/all.qh" #include "../common/playerstats.qh" #include "../common/teams.qh" @@ -55,7 +54,7 @@ vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, * teamscore entities */ -float TeamScore_SendEntity(entity to, float sendflags) +bool TeamScore_SendEntity(entity this, entity to, float sendflags) { float i, p, longflags; @@ -186,7 +185,7 @@ void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags) } } -float ScoreInfo_SendEntity(entity to, int sf) +bool ScoreInfo_SendEntity(entity this, entity to, int sf) { float i; WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES_INFO); @@ -230,7 +229,7 @@ void ScoreInfo_Init(float teams) * per-player score entities */ -float PlayerScore_SendEntity(entity to, float sendflags) +bool PlayerScore_SendEntity(entity this, entity to, float sendflags) { float i, p, longflags; @@ -336,14 +335,15 @@ void PlayerScore_Detach(entity player) float PlayerScore_Add(entity player, float scorefield, float score) { - entity s; + bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score); + score = ret_float; if(gameover) - if(!(g_lms && scorefield == SP_LMS_RANK)) // allow writing to this field in intermission as it is needed for newly joining players + if(!mutator_returnvalue) score = 0; if(!scores_initialized) return 0; // FIXME remove this when everything uses this system - s = player.scorekeeper; + entity s = player.scorekeeper; if(!s) { if(gameover) @@ -537,15 +537,17 @@ void WinningConditionHelper() s = strcat(s, ":human"); else s = strcat(s, ":bot"); - if(!IS_PLAYER(p) && p.caplayer != 1 && !g_lms) + if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(GetPlayerStatus, p, s)) s = strcat(s, ":spectator"); + s = strcat(s, ret_string); } else { - if(IS_PLAYER(p) || p.caplayer == 1 || g_lms) + if(IS_PLAYER(p) || MUTATOR_CALLHOOK(GetPlayerStatus, p, s)) s = GetPlayerScoreString(p, 2); else s = "-666"; + s = strcat(s, ret_string); } if(p.clientstatus)