mirror of
https://github.com/nzp-team/quakec.git
synced 2025-01-18 23:31:38 +00:00
SERVER: Add punchangle when taking explosive damage
This commit is contained in:
parent
72631d96a8
commit
742c9aad86
1 changed files with 16 additions and 0 deletions
|
@ -623,6 +623,22 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra
|
|||
final_damage *= 60;
|
||||
}
|
||||
DamageHandler (ent, ent, final_damage, S_EXPLOSIVE);
|
||||
|
||||
// shake the camera on impact
|
||||
vector distance;
|
||||
distance = inflictor.angles - ent.angles;
|
||||
|
||||
// just to prevent radical punchangles
|
||||
while(distance_x > 10 || distance_x < -10) {
|
||||
distance_x /= 2;
|
||||
}
|
||||
while(distance_y > 10 || distance_y < -10) {
|
||||
distance_y /= 2;
|
||||
}
|
||||
|
||||
// apply
|
||||
ent.punchangle_x = distance_x;
|
||||
ent.punchangle_y = distance_y;
|
||||
}
|
||||
}
|
||||
else if (ent.classname == "explosive_barrel")
|
||||
|
|
Loading…
Reference in a new issue