]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge 3 hooks into 1 and kill another gamemode specific check
authorMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:36:59 +0000 (00:36 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:36:59 +0000 (00:36 +1000)
qcsrc/server/g_world.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/scores.qc

index 05f08f057b8f6f06373d4e1a5933da3244c86da5..e121e6f965a336e27b7e259822ff21822446be79 100644 (file)
@@ -1425,7 +1425,7 @@ void DumpStats(float final)
                {
                        s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
                        s = strcat(s, ftos(rint(time - other.jointime)), ":");
-                       if(IS_PLAYER(other) || other.caplayer == 1 || g_lms)
+                       if(IS_PLAYER(other) || MUTATOR_CALLHOOK(GetPlayerStatus, other, s))
                                s = strcat(s, ftos(other.team), ":");
                        else
                                s = strcat(s, "spectator:");
index 45e4572e8b19682dc865412b0e84a5ecb92ca063..c6815e7fb99c980cf26c00fe587e472765a71353 100644 (file)
@@ -739,21 +739,6 @@ bool want_allguns;
 bool want_mutatorblocked;
 MUTATOR_HOOKABLE(WantWeapon, EV_WantWeapon);
 
-#define EV_SetPlayerFullStatus(i, o) \
-    /**/ i(entity, set_player) \
-    /**/ i(string, ret_string) \
-    /**/ o(string, ret_string) \
-    /**/
-entity set_player;
-MUTATOR_HOOKABLE(SetPlayerFullStatus, EV_SetPlayerFullStatus);
-
-#define EV_SetPlayerStatus(i, o) \
-    /**/ i(entity, set_player) \
-    /**/ i(string, ret_string) \
-    /**/ o(string, ret_string) \
-    /**/
-MUTATOR_HOOKABLE(SetPlayerStatus, EV_SetPlayerStatus);
-
 #define EV_AddPlayerScore(i, o) \
     /**/ i(int, score_field) \
     /**/ i(float, ret_float) \
@@ -761,4 +746,12 @@ MUTATOR_HOOKABLE(SetPlayerStatus, EV_SetPlayerStatus);
     /**/
 int score_field;
 MUTATOR_HOOKABLE(AddPlayerScore, EV_AddPlayerScore);
+
+#define EV_GetPlayerStatus(i, o) \
+    /**/ i(entity, set_player) \
+    /**/ i(string, ret_string) \
+    /**/ o(string, ret_string) \
+    /**/
+entity set_player;
+MUTATOR_HOOKABLE(GetPlayerStatus, EV_GetPlayerStatus);
 #endif
index 8e2d9d9e88a9cef33a2dea4b39c48de3592547d5..af870ec6c62d29b0540bb73d9c82b68f88f57774 100644 (file)
@@ -462,14 +462,7 @@ MUTATOR_HOOKFUNCTION(ca, WantWeapon)
        return false;
 }
 
-MUTATOR_HOOKFUNCTION(ca, SetPlayerFullStatus)
-{
-       if(set_player.caplayer == 1)
-               return true;
-       return false;
-}
-
-MUTATOR_HOOKFUNCTION(ca, SetPlayerStatus)
+MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus)
 {
        if(set_player.caplayer == 1)
                return true;
index facf5771c5c481c421e5922e0444c4837d2ac04e..dc56fb17a1bcf8ed065d7635f58599da056abbbc 100644 (file)
@@ -242,12 +242,7 @@ MUTATOR_HOOKFUNCTION(lms, WantWeapon)
        return false;
 }
 
-MUTATOR_HOOKFUNCTION(lms, SetPlayerFullStatus)
-{
-       return true;
-}
-
-MUTATOR_HOOKFUNCTION(lms, SetPlayerStatus)
+MUTATOR_HOOKFUNCTION(lms, GetPlayerStatus)
 {
        return true;
 }
index 9ef3e1e7521f241c5f6a408585bfd74c14be0ecf..2279e649dd8ac07f7f1a01c0eeb24389f415b27d 100644 (file)
@@ -537,13 +537,13 @@ void WinningConditionHelper()
                                s = strcat(s, ":human");
                        else
                                s = strcat(s, ":bot");
-                       if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(SetPlayerFullStatus, p, s))
+                       if(!IS_PLAYER(p) && !MUTATOR_CALLHOOK(GetPlayerStatus, p, s))
                                s = strcat(s, ":spectator");
                        s = strcat(s, ret_string);
                }
                else
                {
-                       if(IS_PLAYER(p) || MUTATOR_CALLHOOK(SetPlayerStatus, p, s))
+                       if(IS_PLAYER(p) || MUTATOR_CALLHOOK(GetPlayerStatus, p, s))
                                s = GetPlayerScoreString(p, 2);
                        else
                                s = "-666";