From 3df424c2542f711bacf7481dab69f89ccb35c1a7 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 01:25:55 +0200 Subject: [PATCH] Damage leaning: Only lean the player if damage was caused by a weapon. This should prevent the odd behaviors I noticed, of angles getting stuck sometimes --- data/defaultVT.cfg | 2 +- data/qcsrc/server/g_damage.qc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index e02ac843..b23a2d44 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -306,7 +306,7 @@ set g_respawn_ghosts 1 "if 1 dead bodies become ghosts and float away when the p set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rotate" set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last, minimum time is half this value. 0 disables and ghosts fade when the body would" -set g_leanplayer_damage 0.1 "lean players that are shot by this amount, based on the force they take" +set g_leanplayer_damage 0.3 "lean players that are shot by this amount, based on the force they take" set g_leanplayer_damage_fade 0.95 "how fast players return to normal angles, based on damage taken" set g_leanplayer_damage_max 10 "damage leaning is limited to this amount" set g_leanplayer_acceleration 0.05 "lean players as they accelerate, by this amount" diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index 86e1f1b4..fc12a332 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -867,7 +867,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float // lean the player based on the amount of damage taken if(cvar("g_leanplayer_damage")) - if(deathtype != DEATH_DIGESTION && deathtype != DEATH_STOMACHKICK && deathtype != DEATH_REGURGITATION) // prevents some bugs + if(WEP_VALID(DEATH_WEAPONOF(deathtype))) // only for damage caused by weapons { targ.leanangle_damage_loc = hitloc - targ.origin; targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any -- 2.39.2