]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/cl_turrets.qc
GetResourceAmount --> GetResource, SetResourceAmount --> SetResource
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / cl_turrets.qc
index 194cd31d939493492f9e713881ccdf222dcc475f..fd37564a881eead341452a6d2c8646afc15a160a 100644 (file)
@@ -37,7 +37,7 @@ void turret_draw(entity this)
 
        this.tur_head.angles += dt * this.tur_head.avelocity;
 
-       if (GetResourceAmount(this, RES_HEALTH) < 127)
+       if (GetResource(this, RES_HEALTH) < 127)
        {
                dt = random();
 
@@ -45,11 +45,11 @@ void turret_draw(entity this)
                        te_spark(this.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
        }
 
-       if(GetResourceAmount(this, RES_HEALTH) < 85)
+       if(GetResource(this, RES_HEALTH) < 85)
        if(dt < 0.01)
                pointparticles(EFFECT_SMOKE_LARGE, (this.origin + (randomvec() * 80)), '0 0 0', 1);
 
-       if(GetResourceAmount(this, RES_HEALTH) < 32)
+       if(GetResource(this, RES_HEALTH) < 32)
        if(dt < 0.015)
                pointparticles(EFFECT_SMOKE_SMALL, (this.origin + (randomvec() * 80)), '0 0 0', 1);
 
@@ -183,7 +183,7 @@ void turret_draw2d(entity this)
        drawhealthbar(
                        o,
                        0,
-                       GetResourceAmount(this, RES_HEALTH) / 255,
+                       GetResource(this, RES_HEALTH) / 255,
                        '0 0 0',
                        '0 0 0',
                        0.5 * SPRITE_HEALTHBAR_WIDTH * t,
@@ -224,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;
-       SetResourceAmount(this, RES_HEALTH, 255);
+       SetResource(this, RES_HEALTH, 255);
        this.solid                                              = SOLID_BBOX;
        this.tur_head.solid                             = SOLID_NOT;
        set_movetype(this, MOVETYPE_NOCLIP);
@@ -425,7 +425,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
                }
 
                _tmp = ReadByte();
-               float myhp = GetResourceAmount(this, RES_HEALTH);
+               float myhp = GetResource(this, RES_HEALTH);
                if(_tmp == 0 && myhp != 0)
                        turret_die(this);
                else if(myhp && myhp > _tmp)
@@ -433,7 +433,7 @@ NET_HANDLE(ENT_CLIENT_TURRET, bool isnew)
                else if(myhp && myhp < _tmp)
                        this.helpme = 0; // we're being healed, don't spam help me waypoints
 
-               SetResourceAmount(this, RES_HEALTH, _tmp);
+               SetResource(this, RES_HEALTH, _tmp);
        }
        return true;
 }