Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /var/sites/a/ on line 20
Wavelength | Your Game Editing Resource | Spinning Corpses Simple Fix
Welcome, Guest! Login | Register

Spinning Corpses Simple Fix [Print this Article]
Posted by: omega
Date posted: Dec 23 2003
User Rating: 4.4 out of 5.0
Number of views: 6144
Number of comments: 6
Description: A Simple 4-line fix for spinning corpses.
You know how when you die; and your corpse spins around on the ground when you look around? Well, this whopping 4-line tutorial will give you those 4-lines to stop the spinning corpses!

I don't really need to say anything else, so here you go:
(anywhere inside CBasePlayer class definition)
 CODE (c++) 
    Vector v_LastAngles;

Inside PlayerPostThink
 CODE (c++) 
    //omega; fix the corpses.
    if (pev->deadflag == DEAD_NO)
        v_LastAngles = pev->angles;
        pev->angles = v_LastAngles;

This will still allow the player to look around, but the model won't spin with them.


Rate This Article
This article is currently rated: 4.4 out of 5.0 (8 Votes)

You have to register to rate this article.
User Comments Showing comments 1-6

Posted By: morthy on Jan 11 2004 at 08:19:15
Quite useful :)

Posted By: T'Pol on Feb 01 2004 at 15:03:31
There's no such thing as PlayerPostThink in Player.cpp therefore I give it a 4 :)

There's only a PostThink on player.cpp

Posted By: RobotFood on Mar 29 2005 at 21:21:15
thats the function he is referring to, the player => CBasePlayer
its the class. you cant expect him to copy all of it letter for letter, its already easy enough.

Posted By: XWider on Jun 17 2005 at 14:02:08
It would be much better if the CLIENT.DLL would not send dead player's angles down to server.

Posted By: omega on Jun 17 2005 at 23:59:32
yeah but it does because the dead player is still an entity on the server.
the other solution is to make client side corpses (which i did for flf 2.0, and cs 1.5+ has)

Posted By: darkPhoenix on Sep 06 2008 at 00:09:19
I know I'm a little late coming to this particular party ... but I've just recently started tinkering with the HL SDK. All I'm doing so far is fiddling with the HLDM minimod (an unmodified mod until now) that I've been using for a while now to host my own maps.

This snippet of code was the first that I applied once I started poking around the SDK, so thanks for getting me started! It worked just fine. Of course, it also led to a discussion between myself and a mate as to whether we wanted corpses to be able to look around at all, which ultimately led to adding some fade-to-red code upon death -- but it was this that got me started! :-)Edited by darkPhoenix on Sep 06 2008, 00:13:28

You must register to post a comment. If you have already registered, you must login.

Latest Articles
3rd person View in Multiplayer
Half-Life 2 | Coding | Client Side Tutorials
How to enable it in HL2DM

By: cct | Nov 13 2006

Making a Camera
Half-Life 2 | Level Design
This camera is good for when you join a map, it gives you a view of the map before you join a team

By: slackiller | Mar 05 2006

Making a camera , Part 2
Half-Life 2 | Level Design
these cameras are working monitors that turn on when a button is pushed.

By: slackiller | Mar 04 2006

Storing weapons on ladder
Half-Life 2 | Coding | Snippets
like Raven Sheild or BF2

By: British_Bomber | Dec 24 2005

Implementation of a string lookup table
Half-Life 2 | Coding | Snippets
A string lookup table is a set of functions that is used to convert strings to pre-defined values

By: deathz0rz | Nov 13 2005

Latest Comments
knock knock
General | News
By: MIFUNE | Dec 31 2017
knock knock
General | News
By: omega | Dec 22 2016
knock knock
General | News
By: MIFUNE | Oct 10 2015
New HL HUD Message System
Half-Life | Coding | Shared Tutorials
By: chbrules | Dec 31 2011
knock knock
General | News
By: Whistler | Nov 05 2011
Particle Engine tutorial part 4
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 18 2010
Particle Engine tutorial part 2
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Particle Engine tutorial part 3
Half-Life | Coding | Client Side Tutorials
By: darkPhoenix | Feb 11 2010
Game Movement Series #2: Analog Jumping and Floating
Half-Life 2 | Coding | Shared Tutorials
By: mars3554 | Oct 26 2009
Particle Engine tutorial part 5
Half-Life | Coding | Client Side Tutorials
By: Deadpool | Aug 02 2009

Site Info
297 Approved Articless
8 Pending Articles
3940 Registered Members
0 People Online (5 guests)
About - Credits - Contact Us

Wavelength version:
Valid XHTML 1.0! Valid CSS!