Add some mutator hooks to clear out another gamemode reference
authorMario <mario@smbclan.net>
Wed, 14 Dec 2016 20:26:53 +0000 (06:26 +1000)
committerMario <mario@smbclan.net>
Wed, 14 Dec 2016 20:26:53 +0000 (06:26 +1000)
qcsrc/client/hud/panel/infomessages.qc
qcsrc/client/mutators/events.qh
qcsrc/server/command/vote.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/mutator/gamemode_assault.qc

index db102e6..ad2886d 100644 (file)
@@ -114,6 +114,8 @@ void HUD_InfoMessages()
                                InfoMessage(s);
                        }
 
+                       MUTATOR_CALLHOOK(DrawInfoMessages);
+
                        if(!warmup_stage && gametype == MAPINFO_TYPE_LMS)
                        {
                                entity sk;
index 74090e1..12f04fd 100644 (file)
@@ -157,3 +157,6 @@ MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS);
 
 /** Return true to not draw scoreboard */
 MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS);
+
+/** Called when drawing info messages, allows adding new info messages */
+MUTATOR_HOOKABLE(DrawInfoMessages, EV_NO_ARGS);
index 44b8acb..b91a8f4 100644 (file)
@@ -464,8 +464,7 @@ void ReadyRestart_force()
 
 void ReadyRestart()
 {
-       // no assault support yet...
-       if (g_assault || gameover || race_completing) localcmd("restart\n");
+       if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || gameover || race_completing) localcmd("restart\n");
        else localcmd("\nsv_hook_gamerestart\n");
 
        // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off!
index 1ba2c78..09e1cf7 100644 (file)
@@ -914,3 +914,6 @@ MUTATOR_HOOKABLE(ChatMessage, EV_ChatMessage);
     /** sender */ i(entity, MUTATOR_ARGV_1_entity) \
     /**/
 MUTATOR_HOOKABLE(ChatMessageTo, EV_ChatMessageTo);
+
+/** return true to just restart the match, for modes that don't support readyrestart */
+MUTATOR_HOOKABLE(ReadyRestart_Deny, EV_NO_ARGS);
index 2e23264..3998741 100644 (file)
@@ -608,6 +608,12 @@ MUTATOR_HOOKFUNCTION(as, OnEntityPreSpawn)
        }
 }
 
+MUTATOR_HOOKFUNCTION(as, ReadyRestart_Deny)
+{
+       // readyrestart not supported (yet)
+       return true;
+}
+
 // scoreboard setup
 void assault_ScoreRules()
 {