]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Kill another gamemode specific check
authorMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:26:18 +0000 (00:26 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Oct 2015 14:26:18 +0000 (00:26 +1000)
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/scores.qc

index 2066e768c1e5a151452bf993a1c24f2c018ae1f1..c73e432537da2f9100d34c29b104278dea1ca30f 100644 (file)
@@ -738,4 +738,19 @@ entity want_weaponinfo;
 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);
 #endif
index 84b56dabad3976a761c1708463698fa78364c810..8e2d9d9e88a9cef33a2dea4b39c48de3592547d5 100644 (file)
@@ -462,6 +462,20 @@ MUTATOR_HOOKFUNCTION(ca, WantWeapon)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(ca, SetPlayerFullStatus)
+{
+       if(set_player.caplayer == 1)
+               return true;
+       return false;
+}
+
+MUTATOR_HOOKFUNCTION(ca, SetPlayerStatus)
+{
+       if(set_player.caplayer == 1)
+               return true;
+       return false;
+}
+
 void ca_Initialize()
 {
        allowed_to_spawn = true;
index aab3b5542fa317b4b7a2b7aa97c57240aa20ff11..e9a0029d01915232c3561b4c3f34c3f5200f4db0 100644 (file)
@@ -242,6 +242,16 @@ MUTATOR_HOOKFUNCTION(lms, WantWeapon)
        return false;
 }
 
+MUTATOR_HOOKFUNCTION(lms, SetPlayerFullStatus)
+{
+       return true;
+}
+
+MUTATOR_HOOKFUNCTION(lms, SetPlayerStatus)
+{
+       return true;
+}
+
 // scoreboard stuff
 void lms_ScoreRules()
 {
index bb489f76fc72a2c74073a0ae387f3bd001fd1d37..f1b964417d016b6fcc7430770f3adc4137c76333 100644 (file)
@@ -536,15 +536,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(SetPlayerFullStatus, 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(SetPlayerStatus, p, s))
                                s = GetPlayerScoreString(p, 2);
                        else
                                s = "-666";
+                       s = strcat(s, ret_string);
                }
 
                if(p.clientstatus)