]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
Merge branch 'Lyberta/Survival' into Lyberta/master
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / waypoints / waypointsprites.qc
index 8d5fe34ae8373bdf29e14a9dfe87471ac85fdd6e..fd46a712f9b827311eb49eb8ab24b2ba0d08af7d 100644 (file)
@@ -560,11 +560,13 @@ void Draw_WaypointSprite(entity this)
         LOG_INFOF("WARNING: sprite of name %s has no color, using pink so you notice it", spriteimage);
     }
 
-    if (time - floor(time) > 0.5)
+    float health_val = GetResourceAmount(this, RESOURCE_HEALTH);
+    float blink_time = (health_val >= 0) ? (health_val * 10) : time;
+    if (blink_time - floor(blink_time) > 0.5)
     {
         if (this.helpme && time < this.helpme)
             a *= SPRITE_HELPME_BLINK;
-        else if (this.lifetime > 0) // fading out waypoints don't blink
+        else if (!this.lifetime) // fading out waypoints don't blink
             a *= spritelookupblinkvalue(this, spriteimage);
     }
 
@@ -598,7 +600,7 @@ void Draw_WaypointSprite(entity this)
             ang += M_PI;
 
                float f1 = d.x / vid_conwidth;
-               float f2 = d.y / vid_conheight; 
+               float f2 = d.y / vid_conheight;
                if (f1 == 0) { f1 = 0.000001; }
                if (f2 == 0) { f2 = 0.000001; }
 
@@ -1109,7 +1111,7 @@ entity WaypointSprite_SpawnFixed(
 
 entity WaypointSprite_DeployFixed(
     entity spr,
-    float limited_range,
+    bool limited_range,
     entity player,
     vector ofs,
     entity icon // initial icon
@@ -1141,7 +1143,7 @@ entity WaypointSprite_DeployPersonal(
 entity WaypointSprite_Attach(
     entity spr,
     entity player,
-    float limited_range,
+    bool limited_range,
     entity icon // initial icon
 )
 {