]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
To match resource limit behaviour, set the 'unlimited' limit to -1 in event_heal...
authorMario <mario@smbclan.net>
Sun, 17 Jun 2018 08:07:45 +0000 (18:07 +1000)
committerMario <mario@smbclan.net>
Sun, 17 Jun 2018 08:07:45 +0000 (18:07 +1000)
qcsrc/common/gamemodes/gamemode/assault/assault.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/weapon/arc.qc

index 8fb63a9ad5725b2a088d08cd904a06d991938fa2..b9b5c361ce737596a410bf66c02d89419f57211d 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) ? limit : targ.max_health);
+       float true_limit = ((limit >= 0) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index 12475bb7327ea84d1d72900bfd781c1d1d0f260b..90ab772342e537a5a961bf910c5f30dff2463b1f 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) ? limit : targ.max_health);
+       float true_limit = ((limit >= 0) ? 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) ? limit : targ.max_health);
+       float true_limit = ((limit >= 0) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index c208e779ac59506df3a616598bbbb3a7477f5b2e..810732b10ac62a4b55da2efbe40371eeec4df0ff 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) ? limit : targ.max_health);
+       float true_limit = ((limit >= 0) ? limit : targ.max_health);
        if(GetResourceAmount(targ, RESOURCE_HEALTH) <= 0 || GetResourceAmount(targ, RESOURCE_HEALTH) >= true_limit)
                return false;
 
index b0fef4c3f63c17437852b35817975af243633c1a..5284664e96b8da4551495d8618655a1d533d1727 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) ? limit : targ.max_health);
+       float true_limit = ((limit >= 0) ? 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 5233917b627e903bebce6eb6d6e7189028e31030..fc4b92a55b82b1427b00efa1c9137b5dc0c786de 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) : 0);
+                               float hplimit = ((IS_PLAYER(trace_ent)) ? WEP_CVAR(arc, beam_healing_hmax) : -1);
                                Heal(trace_ent, own, (roothealth * coefficient), hplimit);
                                if(IS_PLAYER(trace_ent) && rootarmor)
                                {