From 1e82474971394c8b3b228e4cde843638fd908a77 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Tue, 15 Nov 2011 23:37:18 +0200 Subject: [PATCH] Add code comments --- data/qcsrc/client/sbar.qc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index 0371c39b..82ce78b9 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -3078,6 +3078,7 @@ void Sbar_Draw (void) fade = 3.2 - 2 * (time - weapontime); fade = bound(0.7, fade, 1); + // when a player's armor is below the necessary level, subsystems will not work if(getstati(STAT_HEALTH) > 0) { vector warn_pos; @@ -3085,18 +3086,18 @@ void Sbar_Draw (void) warn_pos_y = vid_conheight - vid_conheight / 2.5; if(getstati(STAT_ARMOR) < g_power) { + // subsystems are down drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL); - power_boot = time + g_power_reboot; - return; + return; // skip drawing the HUD } else if(time <= power_boot) { + // subsystems are rebooting drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_reboot", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_reboot_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL); - - return; + return; // skip drawing the HUD } } -- 2.39.2