mirror of
https://github.com/nzp-team/quakec.git
synced 2024-11-25 21:31:28 +00:00
Server: Add support for Explosive Barrels to be damaged by other
Explosives
This commit is contained in:
parent
aa9965e2f1
commit
327c9cdc43
1 changed files with 18 additions and 0 deletions
|
@ -30,6 +30,8 @@
|
|||
void (float achievement_id, optional entity who) GiveAchievement;
|
||||
#endif // NX
|
||||
|
||||
void() Barrel_Hit;
|
||||
|
||||
void() EndGame_Restart =
|
||||
{
|
||||
localcmd("restart");
|
||||
|
@ -529,6 +531,22 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra
|
|||
DamageHandler (attacker, attacker, final_damage, S_EXPLOSIVE);
|
||||
}
|
||||
}
|
||||
else if (ent.classname == "explosive_barrel")
|
||||
{
|
||||
final_damage = radius - vlen(inflictor.origin - ent.origin);
|
||||
final_damage *= 4;
|
||||
|
||||
if (final_damage < 0)
|
||||
continue;
|
||||
|
||||
ent.health -= final_damage;
|
||||
|
||||
entity oldself;
|
||||
oldself = self;
|
||||
self = ent;
|
||||
Barrel_Hit();
|
||||
self = oldself;
|
||||
}
|
||||
else if (ent.takedamage && ent.classname != "ai_zombie_head" && ent.classname != "ai_zombie_larm" && ent.classname != "ai_zombie_rarm")
|
||||
{
|
||||
// verify we aren't doin anything with a bmodel
|
||||
|
|
Loading…
Reference in a new issue