]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add comments to describe how some variables are used in health/armor progressbar...
authorterencehill <piuntn@gmail.com>
Sun, 24 Apr 2011 22:37:44 +0000 (00:37 +0200)
committerterencehill <piuntn@gmail.com>
Sun, 24 Apr 2011 22:37:44 +0000 (00:37 +0200)
qcsrc/client/hud.qc

index 9eb99ba59c08f3ef3d87a10e7ddd0121209e4efb..7203c87ec09c8b59eca148ff8286ccef8bc84c3c 100644 (file)
@@ -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;