]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to hide the team nagger (clears out 3 gamemode specific checks)
authorMario <mario@smbclan.net>
Mon, 6 Mar 2017 07:38:08 +0000 (17:38 +1000)
committerMario <mario@smbclan.net>
Mon, 6 Mar 2017 07:38:08 +0000 (17:38 +1000)
qcsrc/client/hud/panel/infomessages.qc
qcsrc/server/client.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_race.qc

index 2d6c952fc0f3764cfced6e99448be1a14628dd47..49739a42df7599e2b63b4370a7226842e68bfd57 100644 (file)
@@ -176,7 +176,7 @@ void HUD_InfoMessages()
                        InfoMessage(s);
                }
 
-               if(teamplay && !spectatee_status && gametype != MAPINFO_TYPE_CA && teamnagger)
+               if(teamplay && !spectatee_status && teamnagger)
                {
                        float ts_min = 0, ts_max = 0;
                        entity tm = teams.sort_next;
index f6e4c8391d4413d97105b0477cd9a2170d75f710..5506a9d0fa353d290f71c6776ea5aa2a9e503adf 100644 (file)
@@ -1214,7 +1214,7 @@ void ClientConnect(entity this)
                stuffcmd(this, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
 
        if (autocvar_sv_teamnagger && !(autocvar_bot_vs_human && AvailableTeams() == 2))
-               if (!g_ca && !g_cts && !g_race) // teamnagger is currently bad for ca, race & cts
+               if(!MUTATOR_CALLHOOK(HideTeamNagger, this))
                        send_CSQC_teamnagger();
 
        CSQCMODEL_AUTOINIT(this);
index 9550daadcf3a715ff6e1940fcda25b771a64b770..729106057644511f3795a42906ce0486c1b7530e 100644 (file)
@@ -941,3 +941,9 @@ enum {
     MUT_FUSREAC_TARG_VALID, // return this flag to make the function return true (valid target)
     MUT_FUSREAC_TARG_INVALID // return this flag to make the function return false (invalid target)
 };
+
+/** return true to hide the 'teamnumbers are imbalanced' message */
+#define EV_HideTeamNagger(i, o) \
+    /** player */ i(entity, MUTATOR_ARGV_0_entity) \
+    /**/
+MUTATOR_HOOKABLE(HideTeamNagger, EV_HideTeamNagger);
index e8dcdfea5a67664f5b551468b660a4be20109438..fc06e50e29d73501a0e29d1c35d082325064fec3 100644 (file)
@@ -458,6 +458,11 @@ MUTATOR_HOOKFUNCTION(ca, WantWeapon)
        M_ARGV(2, bool) = true; // all weapons
 }
 
+MUTATOR_HOOKFUNCTION(ca, HideTeamNagger)
+{
+       return true; // doesn't work well with the whole spectator as player thing
+}
+
 MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus)
 {
        entity player = M_ARGV(0, entity);
index daec722f4f62e1dd9eab1871bd5fa8459300029b..aeae1e1b9722c24a4bb14d392d2a5e35839cacf7 100644 (file)
@@ -387,6 +387,11 @@ MUTATOR_HOOKFUNCTION(cts, Race_FinalCheckpoint)
                CTS_ClientKill(player);
 }
 
+MUTATOR_HOOKFUNCTION(cts, HideTeamNagger)
+{
+       return true; // doesn't work so well (but isn't cts a teamless mode?)
+}
+
 MUTATOR_HOOKFUNCTION(cts, FixClientCvars)
 {
        entity player = M_ARGV(0, entity);
index 2945aff6e83c3da20a745f2b7fe74d23e3dd2aa5..c41586c0464d141bcdfb90c1840277688af2a52a 100644 (file)
@@ -385,6 +385,11 @@ MUTATOR_HOOKFUNCTION(rc, GetRecords)
        M_ARGV(1, string) = ret_string;
 }
 
+MUTATOR_HOOKFUNCTION(rc, HideTeamNagger)
+{
+       return true; // doesn't work so well
+}
+
 MUTATOR_HOOKFUNCTION(rc, FixClientCvars)
 {
        entity player = M_ARGV(0, entity);