From: terencehill Date: Mon, 22 Apr 2019 20:57:41 +0000 (+0200) Subject: Add some safety checks X-Git-Tag: xonotic-v0.8.5~1537 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7a32c5ee0e19e06541a030338394683d90973760;p=xonotic%2Fxonotic-data.pk3dir.git Add some safety checks --- diff --git a/qcsrc/common/minigames/cl_minigames_hud.qc b/qcsrc/common/minigames/cl_minigames_hud.qc index f299af3c3..fba0bb198 100644 --- a/qcsrc/common/minigames/cl_minigames_hud.qc +++ b/qcsrc/common/minigames/cl_minigames_hud.qc @@ -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";