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: 2331
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:
player.h:
(anywhere inside CBasePlayer class definition)
 CODE (c++) 
    Vector v_LastAngles;


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

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

Enjoy.

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 02:19:15
Quite useful :)

Posted By: T'Pol on Feb 01 2004 at 09: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 14: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 08: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 17: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 05 2008 at 18: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 05 2008, 18: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 04 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
Spinning Corpses Simple Fix
Half-Life | Coding | Snippets
By: darkPhoenix | Sep 05 2008
 
Where do we go from here
General | News
By: MIFUNE | Jun 09 2008
 
The Input/Output system
Half-Life 2 | Level Design
By: nazitaco | Dec 23 2007
 
Where do we go from here
General | News
By: Rob_F | Nov 22 2007
 
Rescaling Half-Life
Half-Life | Coding | Shared Tutorials
By: christoph | Nov 12 2007
 
GameUI
Half-Life 2 | Coding | Client Side Tutorials
By: Evil_j | Oct 29 2007
 
3 State Zoom For Any Weapon
Half-Life 2 | Coding | Server Side Tutorials
By: Ennuified | Oct 18 2007
 
Storing weapons on ladder
Half-Life 2 | Coding | Snippets
By: cct | Sep 07 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: DarkNight | Aug 28 2007
 
CTF Gameplay Part 1
Half-Life | Coding | Shared Tutorials
By: deedok | Aug 20 2007
 

Site Info
296 Approved Articless
5 Pending Articles
3940 Registered Members
2 People Online (29 guests)
About - Credits - Contact Us

Wavelength version: 3.0.0.9
Valid XHTML 1.0! Valid CSS!