]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/scores.qc
Cleanse vehicles of SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / scores.qc
index efefcd17aaa26cf16897100a0123270dba7eba42..8be145b0166ba2c9887c11d1e6c4e9a0c77a956c 100644 (file)
@@ -333,8 +333,8 @@ void PlayerScore_Detach(entity player)
 
 float PlayerScore_Add(entity player, float scorefield, float score)
 {
-       bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score);
-       score = ret_float;
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player);
+       score = M_ARGV(1, float);
 
        if(gameover)
        if(!mutator_returnvalue)
@@ -385,9 +385,8 @@ float PlayerScore_Compare(entity t1, entity t2, float strict)
        return result.x;
 }
 
-void WinningConditionHelper()
+void WinningConditionHelper(entity this)
 {
-    SELFPARAM();
        float c;
        string s;
        float fullstatus;
@@ -406,7 +405,7 @@ void WinningConditionHelper()
        s = GetGametype();
        s = strcat(s, ":", autocvar_g_xonoticversion);
        s = strcat(s, ":P", ftos(cvar_purechanges_count));
-       s = strcat(s, ":S", ftos(nJoinAllowed(this, world))); // note: self/this is most likely world in this case
+       s = strcat(s, ":S", ftos(nJoinAllowed(this, world)));
        s = strcat(s, ":F", ftos(serverflags));
        s = strcat(s, ":M", modname);
        s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2)));
@@ -531,19 +530,15 @@ void WinningConditionHelper()
                {
                        s = GetPlayerScoreString(it, 1);
                        s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot");
-                       ret_string = string_null;
-                       if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
+                       if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it))
                                s = strcat(s, ":spectator");
-                       if (ret_string) s = strcat(s, ret_string);
                }
                else
                {
-                       ret_string = string_null;
-                       if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
+                       if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it))
                                s = GetPlayerScoreString(it, 2);
                        else
                                s = "-666";
-                       if (ret_string) s = strcat(s, ret_string);
                }
 
                if(it.clientstatus)