]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
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 db102e60e8b6fb7fb17d6223a8268fbb20025fc5..ad2886d53c06953214323b0834c73337abff4beb 100644 (file)
@@ -114,6 +114,8 @@ void HUD_InfoMessages()
                                InfoMessage(s);
                        }
 
+                       MUTATOR_CALLHOOK(DrawInfoMessages);
+
                        if(!warmup_stage && gametype == MAPINFO_TYPE_LMS)
                        {
                                entity sk;
index 74090e14d6992749c8b747c04894a20279c8d7bf..12f04fdfbb13383950228f8822b566127c58a1de 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 44b8acb8e7a8ff5fb9ea7e18688e269b3bd66be9..b91a8f4df3e208633e21e0d7ee40ef12fcddffc1 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 1ba2c785c9566fb0c1f71eb33215418510f4f9d4..09e1cf70bd212497b69907be4ec13c31e97d33ca 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 2e23264248039a27e61bcc223e5c9240b508e7f7..39987414348d0d3a37556741a320eb755e3a1cb3 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()
 {