X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fwaypoints%2Fwaypointsprites.qc;h=fd46a712f9b827311eb49eb8ab24b2ba0d08af7d;hb=refs%2Fheads%2FLyberta%2Fmaster;hp=8d5fe34ae8373bdf29e14a9dfe87471ac85fdd6e;hpb=aa61613b9fea4bb405ddb3f9ab31847993e45661;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 8d5fe34ae..fd46a712f 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -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 ) {