]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add some safety checks
authorterencehill <piuntn@gmail.com>
Mon, 22 Apr 2019 20:57:41 +0000 (22:57 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 22 Apr 2019 20:57:41 +0000 (22:57 +0200)
qcsrc/common/minigames/cl_minigames_hud.qc

index f299af3c3a086c2cae4735b989c2c7396044a77a..fba0bb198bdee9629bf7e4c069d58322b6261a64 100644 (file)
@@ -29,7 +29,11 @@ void HUD_MinigameBoard ()
        entity hud_minigame = NULL;
 
        if(!autocvar__hud_configure)
+       {
+               if (!active_minigame)
+                       return;
                hud_minigame = active_minigame.descriptor;
+       }
        else
                hud_minigame = minigame_get_descriptor("nmm");
 
@@ -55,7 +59,11 @@ void HUD_MinigameStatus ()
        entity hud_minigame = NULL;
 
        if(!autocvar__hud_configure)
+       {
+               if (!active_minigame)
+                       return;
                hud_minigame = active_minigame.descriptor;
+       }
        else
                hud_minigame = minigame_get_descriptor("nmm");
 
@@ -534,7 +542,11 @@ void HUD_MinigameHelp()
        string help_message;
 
        if(!autocvar__hud_configure)
+       {
+               if (!active_minigame)
+                       return;
                help_message = active_minigame.message;
+       }
        else
                help_message = "Minigame message";