]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use the new unlimited resource constant
authorMario <mario@smbclan.net>
Sun, 17 Jun 2018 22:32:39 +0000 (08:32 +1000)
committerMario <mario@smbclan.net>
Sun, 17 Jun 2018 22:32:39 +0000 (08:32 +1000)
qcsrc/common/gamemodes/gamemode/assault/assault.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/vehicle/bumblebee.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/server/resources.qc

index b9b5c361ce737596a410bf66c02d89419f57211d..9a2d6af1d86f4efbfb300b774d22f0ed6b9dae06 100644 (file)
@@ -333,7 +333,7 @@ spawnfunc(target_objective_decrease)
 // destructible walls that can be used to trigger target_objective_decrease
 bool destructible_heal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index 90ab772342e537a5a961bf910c5f30dff2463b1f..fd050df0a0f541cc0137303fe86ad15ab26ba60b 100644 (file)
@@ -449,7 +449,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
 
 bool ons_ControlPoint_Icon_Heal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
@@ -963,7 +963,7 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d
 
 bool ons_GeneratorHeal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index a49430fbc88f58a1cbdc55e8dbc56ee96c2a284f..88120a0ea7550acbb93cd46e9b94022165b18ba2 100644 (file)
@@ -269,7 +269,7 @@ void M_Mage_Defend_Heal(entity this)
                else
                {
                        Send_Effect(EFFECT_HEALING, it.origin, '0 0 0', 1);
-                       Heal(it, this, autocvar_g_monster_mage_heal_allies, -1);
+                       Heal(it, this, autocvar_g_monster_mage_heal_allies, RESOURCE_LIMIT_NONE);
                        if(!(it.spawnflags & MONSTERFLAG_INVINCIBLE) && it.sprite)
                                WaypointSprite_UpdateHealth(it.sprite, GetResourceAmount(it, RESOURCE_HEALTH));
                }
index 810732b10ac62a4b55da2efbe40371eeec4df0ff..84355c7f3530ffddcf3dccde86781d487c7fd717 100644 (file)
@@ -1061,7 +1061,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage
 
 bool Monster_Heal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index db33ca7cb4def2ddb22f2e64c3d314ce2cdd543e..b68aca16feddd93b6ea01b555b49aa6b17d2c53a 100644 (file)
@@ -261,7 +261,7 @@ void turret_damage(entity this, entity inflictor, entity attacker, float damage,
 
 bool turret_heal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index 5284664e96b8da4551495d8618655a1d533d1727..df0f5d91693946c7230fb95d37f0dfb6b773aecd 100644 (file)
@@ -729,7 +729,7 @@ void vehicles_damage(entity this, entity inflictor, entity attacker, float damag
 
 bool vehicles_heal(entity targ, entity inflictor, float amount, float limit)
 {
-       float true_limit = ((limit >= 0) ? limit : targ.max_health);
+       float true_limit = ((limit != RESOURCE_LIMIT_NONE) ? limit : targ.max_health);
        //if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
        if(targ.vehicle_health <= 0 || targ.vehicle_health >= true_limit)
                return false;
index 32a5a2aded881324acc4c6f50350ecf3c58b39db..c340d947035617492da6d224bbede286baf8e7be 100644 (file)
@@ -549,7 +549,7 @@ bool bumblebee_pilot_frame(entity this, float dt)
                                        {
                                                if(autocvar_g_vehicle_bumblebee_healgun_hps)
                                                {
-                                                       float hplimit = ((IS_PLAYER(trace_ent)) ? autocvar_g_vehicle_bumblebee_healgun_hmax : -1);
+                                                       float hplimit = ((IS_PLAYER(trace_ent)) ? autocvar_g_vehicle_bumblebee_healgun_hmax : RESOURCE_LIMIT_NONE);
                                                        Heal(trace_ent, this, autocvar_g_vehicle_bumblebee_healgun_hps * dt, hplimit);
                                                }
 
index fc4b92a55b82b1427b00efa1c9137b5dc0c786de..40f9ea765a6dda88428db9731dc965685004a210 100644 (file)
@@ -424,7 +424,7 @@ void W_Arc_Beam_Think(entity this)
                        {
                                float roothealth = ((burst) ? WEP_CVAR(arc, burst_healing_hps) : WEP_CVAR(arc, beam_healing_hps));
                                float rootarmor = ((burst) ? WEP_CVAR(arc, burst_healing_aps) : WEP_CVAR(arc, beam_healing_aps));
-                               float hplimit = ((IS_PLAYER(trace_ent)) ? WEP_CVAR(arc, beam_healing_hmax) : -1);
+                               float hplimit = ((IS_PLAYER(trace_ent)) ? WEP_CVAR(arc, beam_healing_hmax) : RESOURCE_LIMIT_NONE);
                                Heal(trace_ent, own, (roothealth * coefficient), hplimit);
                                if(IS_PLAYER(trace_ent) && rootarmor)
                                {
index 3614daf49e9fc1f4778c411d39e104ff656c93e7..b3b19095ae8b14e7832b386d1f5614c891a3d93f 100644 (file)
@@ -182,7 +182,7 @@ void GiveResourceWithLimit(entity receiver, int resource_type, float amount,
                return;
        }
        float current_amount = GetResourceAmount(receiver, resource_type);
-       if (current_amount + amount > limit)
+       if (current_amount + amount > limit && limit != RESOURCE_LIMIT_NONE)
        {
                amount = limit - current_amount;
        }