// 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;
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;
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;
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));
}
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;
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;
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;
{
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);
}
{
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)
{
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;
}