From fe3b020864d604c5a8b58645e5bb03fa23498093 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 27 Aug 2011 19:15:09 +0300 Subject: [PATCH] Don't fade player leaning back to normal based on damage any more. It didn't work as intended, and might have also been buggy. --- data/defaultVT.cfg | 2 +- data/qcsrc/server/cl_client.qc | 12 +++--------- data/qcsrc/server/defs.qh | 1 - data/qcsrc/server/g_damage.qc | 1 - 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 84e235fa..6368811c 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -300,7 +300,7 @@ set g_respawn_ghosts_speed 5 "the speed with which respawn ghosts float and rota 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_fade 0.001 "how fast players return to normal angles, based on damage taken" +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" set g_leanplayer_acceleration_fade 5 "velocity averaging steps for acceleration, higher values cause a shorter leaning" diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 1ff6d43b..945b419f 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -2591,15 +2591,9 @@ void PlayerPreThink (void) LA = AnglesTransform_Multiply(LA, LF); - // fade the player back to normal rotation each frame, based on how much damage they have taken - // this is used to simulate damage, so a wounded player will get back up slower - if(self.leanangle_damage) // prevent division by zero - if(self.leanangle_damage_force) // extra safety - { - float leanangle_damage_fade; - leanangle_damage_fade = 1 / (1 + (self.leanangle_damage * cvar("g_leanplayer_damage_fade"))); - self.leanangle_damage_force = self.leanangle_damage_force * leanangle_damage_fade; - } + // fade the player back to normal rotation each frame + if(self.leanangle_damage_force) // safety + self.leanangle_damage_force = self.leanangle_damage_force * cvar("g_leanplayer_damage_fade"); // end of damage leaning self.angles = AnglesTransform_Normalize(AnglesTransform_ToAngles(LA), TRUE); diff --git a/data/qcsrc/server/defs.qh b/data/qcsrc/server/defs.qh index 9df71320..a401f697 100644 --- a/data/qcsrc/server/defs.qh +++ b/data/qcsrc/server/defs.qh @@ -298,7 +298,6 @@ entity timeoutInitiator; // contains the entity of the player who started the la float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily .vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed .vector leanangle_damage_loc, leanangle_damage_force; // used for leaning the player model -.float leanangle_damage; entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds void timeoutHandler_Think(); void evaluateTimeout(); diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index 02411d41..920975bf 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -870,7 +870,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { targ.leanangle_damage_loc = hitloc - targ.origin; targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any - targ.leanangle_damage = damage; // bound angles to the specified limit targ.leanangle_damage_force_x = bound(-cvar("g_leanplayer_damage_max"), targ.leanangle_damage_force_x, cvar("g_leanplayer_damage_max")); -- 2.39.2