mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-26 05:41:20 +00:00
SERVER: Perform traces before explosives damaging entities or triggering Bouncing Betty
This commit is contained in:
parent
c8e5a75ed9
commit
5caf23cf4a
2 changed files with 9 additions and 7 deletions
|
@ -577,7 +577,7 @@ float(float min, float max, vector org1, vector org2, float radius) calculate_pr
|
|||
|
||||
void(entity inflictor, entity attacker, float damage2, float mindamage, float radius) DamgageExplode =
|
||||
{
|
||||
float final_damage;
|
||||
float final_damage = 0;
|
||||
entity ent;
|
||||
|
||||
float multi, r;
|
||||
|
@ -617,7 +617,6 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra
|
|||
final_damage /= radius;
|
||||
final_damage *= 60;
|
||||
}
|
||||
DamageHandler (ent, ent, final_damage, S_EXPLOSIVE);
|
||||
}
|
||||
// shake the camera on impact
|
||||
vector distance;
|
||||
|
@ -724,12 +723,12 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra
|
|||
if (final_damage / ent.health > 0.10 && ent.crawling != true && ent.classname != "ai_dog") {
|
||||
ent.crawling = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (final_damage > 0) {
|
||||
if (CanDamage (ent, inflictor))
|
||||
DamageHandler (ent, attacker, final_damage, S_EXPLOSIVE);
|
||||
}
|
||||
}
|
||||
ent = ent.chain;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -56,6 +56,9 @@ void() Betty_Touch =
|
|||
// Additional sanity check -- don't activate because of us.
|
||||
if (other == self.owner || other.solid == SOLID_TRIGGER)
|
||||
return;
|
||||
// Don't activate if our center point can't even reach the enemy
|
||||
if (!CanDamage(other, self))
|
||||
return;
|
||||
|
||||
// Next step is to rise!
|
||||
self.think = Betty_Rise;
|
||||
|
|
Loading…
Reference in a new issue