]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Remove player model leaning from the code. It's too buggy, problematic, and not done...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 3 Feb 2013 00:39:32 +0000 (02:39 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 3 Feb 2013 00:39:32 +0000 (02:39 +0200)
data/qcsrc/server/cl_client.qc
data/qcsrc/server/defs.qh
data/qcsrc/server/g_damage.qc

index aedf04dbb1acbc944352f4edabeb54cdd8debddf..2f0b07d26b6912d3390c03a7e1a07b96e3eab0b8 100644 (file)
@@ -942,7 +942,6 @@ void PutClientInServer (void)
 \r
                self.angles_z = 0; // never spawn tilted even if the spot says to\r
                self.fixangle = TRUE; // turn this way immediately\r
-               self.leanangle_damage_force = '0 0 0';\r
                self.velocity = '0 0 0';\r
                self.avelocity = '0 0 0';\r
                self.punchangle = '0 0 0';\r
@@ -2672,57 +2671,6 @@ void PlayerPreThink (void)
                        self.fixangle = TRUE;\r
                }\r
 \r
-               if(self.deadflag == DEAD_NO && !self.stat_eaten)  // prevents bugs\r
-               {\r
-                       // lean the player with damage and acceleration\r
-                       // credits go to divVerent for these maths :)\r
-                       vector L0, L1, LF, LA;\r
-\r
-                       LA = AnglesTransform_FromAngles(self.angles);\r
-\r
-                       // acceleration leaning\r
-                       if(cvar("g_leanplayer_acceleration"))\r
-                       {\r
-                               // average velocity to obtain a smooth acceleration\r
-                               float f;\r
-                               f = frametime * cvar("g_leanplayer_acceleration_fade");\r
-                               self.avg_vel = self.avg_vel * (1 - f) + self.velocity * f;\r
-                       }\r
-\r
-                       vector accel;\r
-                       accel = self.velocity - self.avg_vel * cvar("g_leanplayer_acceleration"); // acceleration\r
-\r
-                       // bound angles to the specified limit\r
-                       accel_x = bound(-cvar("g_leanplayer_acceleration_max"), accel_x, cvar("g_leanplayer_acceleration_max"));\r
-                       accel_y = bound(-cvar("g_leanplayer_acceleration_max"), accel_y, cvar("g_leanplayer_acceleration_max"));\r
-                       accel_z = bound(-cvar("g_leanplayer_acceleration_max"), accel_z, cvar("g_leanplayer_acceleration_max"));\r
-\r
-                       L0_x = vlen(accel) * -1;\r
-                       L0_y = L1_y = vectoyaw(accel);\r
-\r
-                       L0 = AnglesTransform_FromAngles(L0);\r
-                       L1 = AnglesTransform_FromAngles(L1);\r
-                       LF = AnglesTransform_Multiply(AnglesTransform_Invert(L1), L0);\r
-                       LA = AnglesTransform_Multiply(LA, LF);\r
-                       // end of acceleration leaning\r
-\r
-                       // damage leaning\r
-                       L0 = vectoangles(self.leanangle_damage_loc);\r
-                       L1 = vectoangles(self.leanangle_damage_loc + self.leanangle_damage_force);\r
-\r
-                       L0 = AnglesTransform_FromAngles(L0);\r
-                       L1 = AnglesTransform_FromAngles(L1);\r
-                       LF = AnglesTransform_Multiply(AnglesTransform_Invert(L1), L0);\r
-\r
-                       LA = AnglesTransform_Multiply(LA, LF);\r
-\r
-                       // fade the player back to normal rotation each frame\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
-               }\r
-\r
                SetPlayerSize();\r
 \r
                if(frametime)\r
index 0109de5eb9dc8d6b05de27a7534385311416fcb7..9bd4ed857bd39f7877bc8ab6a407ba5f61215ecc 100644 (file)
@@ -297,7 +297,6 @@ float timeoutStatus; // (values: 0, 1, 2) contains whether a timeout is not acti
 entity timeoutInitiator; // contains the entity of the player who started the last timeout\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
 entity timeoutHandler; //responsible for centerprinting the timeout countdowns and playing sounds\r
 void timeoutHandler_Think();\r
 void evaluateTimeout();\r
index b0270d8cd78545d0ce6b5b946af2b3f0c67ce978..1c7a4b2ebbe1c62b56c69b246fa324b24a0898e4 100644 (file)
@@ -874,19 +874,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                }\r
                        }\r
                }\r
-\r
-               // lean the player based on the amount of damage taken\r
-               if(cvar("g_leanplayer_damage"))\r
-               if(targ.classname == "player" && WEP_VALID(DEATH_WEAPONOF(deathtype))) // only for damage caused by weapons\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
-\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
-                       targ.leanangle_damage_force_y = bound(-cvar("g_leanplayer_damage_max"), targ.leanangle_damage_force_y, cvar("g_leanplayer_damage_max"));\r
-                       targ.leanangle_damage_force_z = bound(-cvar("g_leanplayer_damage_max"), targ.leanangle_damage_force_z, cvar("g_leanplayer_damage_max"));\r
-               }\r
        }\r
 \r
        // apply push\r