]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/cl_turrets.qc
Purge SetResourceAmountExplicit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / cl_turrets.qc
index fb27cd12137fef8e36cd30dfb09f133077c3cf6c..51d3bc7fcee9958d5169e823299e4790966e421a 100644 (file)
@@ -176,7 +176,10 @@ void turret_draw2d(entity this)
        }
 
        o = drawspritearrow(o, M_PI, rgb, a, SPRITE_ARROW_SCALE * t);
-       o = drawsprite_TextOrIcon(true, o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
+       if(autocvar_g_waypointsprite_turrets_text)
+       {
+               o = drawsprite_TextOrIcon(true, o, M_PI, (SPRITE_HEALTHBAR_WIDTH + 2 * SPRITE_HEALTHBAR_BORDER) * t, rgb, a, waypointsprite_fontsize * '1 1 0', txt);
+       }
        drawhealthbar(
                        o,
                        0,
@@ -221,7 +224,7 @@ void turret_construct(entity this, bool isnew)
        set_movetype(this.tur_head, MOVETYPE_NOCLIP);
        set_movetype(this, MOVETYPE_NOCLIP);
        this.tur_head.angles                    = this.angles;
-       SetResourceAmountExplicit(this, RESOURCE_HEALTH, 255);
+       SetResourceAmount(this, RESOURCE_HEALTH, 255);
        this.solid                                              = SOLID_BBOX;
        this.tur_head.solid                             = SOLID_NOT;
        set_movetype(this, MOVETYPE_NOCLIP);
@@ -425,10 +428,12 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
                float myhp = GetResourceAmount(this, RESOURCE_HEALTH);
                if(_tmp == 0 && myhp != 0)
                        turret_die(this);
-               else if(myhp && myhp != _tmp)
+               else if(myhp && myhp > _tmp)
                        this.helpme = servertime + 10;
+               else if(myhp && myhp < _tmp)
+                       this.helpme = 0; // we're being healed, don't spam help me waypoints
 
-               SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp);
+               SetResourceAmount(this, RESOURCE_HEALTH, _tmp);
        }
        return true;
 }