From 6834de4f3ea1da6f264cfbc59a36694848cfcacb Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 25 Apr 2011 00:37:44 +0200 Subject: [PATCH] add comments to describe how some variables are used in health/armor progressbar effects code --- qcsrc/client/hud.qc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 9eb99ba59..7203c87ec 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1300,10 +1300,22 @@ void HUD_Powerups(void) // Health/armor (#3) // -float health_time, prev_health; -float armor_time, prev_armor; + +// prev_* vars contain the health/armor at the previous FRAME +float prev_health, prev_armor; + +// *_time vars contain time at which damage happened + // health_time -1 remembers that player was dead +float health_time, armor_time; + +// saved_* vars contain the old health/armor value (before the damage happened) + // special cases: + // -2: during the load effect (spawning) + // -1: load or damage effect are ended normally + // 0: when effects are forcedly stopped; this is to avoid unintended effects as soon as we switch spectated player (e.g. from playerX: 70h to playerY: 50h) var float saved_health = -2; var float saved_armor = -2; + void HUD_HealthArmor(void) { float armor, health, fuel; -- 2.39.2