From: terencehill Date: Sun, 24 Apr 2011 22:37:44 +0000 (+0200) Subject: add comments to describe how some variables are used in health/armor progressbar... X-Git-Tag: xonotic-v0.5.0~269^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6834de4f3ea1da6f264cfbc59a36694848cfcacb;p=xonotic%2Fxonotic-data.pk3dir.git add comments to describe how some variables are used in health/armor progressbar effects code --- 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;