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"\r
\r
set g_leanplayer_damage 0.1 "lean players that are shot by this amount, based on the force they take"\r
-set g_leanplayer_damage_fade 0.001 "how fast players return to normal angles, based on damage taken"\r
+set g_leanplayer_damage_fade 0.95 "how fast players return to normal angles, based on damage taken"\r
set g_leanplayer_damage_max 10 "damage leaning is limited to this amount"\r
set g_leanplayer_acceleration 0.05 "lean players as they accelerate, by this amount"\r
set g_leanplayer_acceleration_fade 5 "velocity averaging steps for acceleration, higher values cause a shorter leaning"\r
\r
LA = AnglesTransform_Multiply(LA, LF);\r
\r
- // fade the player back to normal rotation each frame, based on how much damage they have taken\r
- // this is used to simulate damage, so a wounded player will get back up slower\r
- if(self.leanangle_damage) // prevent division by zero\r
- if(self.leanangle_damage_force) // extra safety\r
- {\r
- float leanangle_damage_fade;\r
- leanangle_damage_fade = 1 / (1 + (self.leanangle_damage * cvar("g_leanplayer_damage_fade")));\r
- self.leanangle_damage_force = self.leanangle_damage_force * leanangle_damage_fade;\r
- }\r
+ // fade the player back to normal rotation each frame\r
+ if(self.leanangle_damage_force) // safety\r
+ self.leanangle_damage_force = self.leanangle_damage_force * cvar("g_leanplayer_damage_fade");\r
// end of damage leaning\r
\r
self.angles = AnglesTransform_Normalize(AnglesTransform_ToAngles(LA), TRUE);\r
float orig_slowmo; // contains the value of cvar("slowmo") so that, after timeout finished, it isn't set to slowmo 1 necessarily\r
.vector lastV_angle; //used when pausing the game in order to force the player to keep his old view angle fixed\r
.vector leanangle_damage_loc, leanangle_damage_force; // used for leaning the player model\r
-.float leanangle_damage;\r
entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds\r
void timeoutHandler_Think();\r
void evaluateTimeout();\r
{\r
targ.leanangle_damage_loc = hitloc - targ.origin;\r
targ.leanangle_damage_force += force * cvar("g_leanplayer_damage"); // keep existing force if any\r
- targ.leanangle_damage = damage;\r
\r
// bound angles to the specified limit\r
targ.leanangle_damage_force_x = bound(-cvar("g_leanplayer_damage_max"), targ.leanangle_damage_force_x, cvar("g_leanplayer_damage_max"));\r