diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/hl2/c_corpse.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/hl2/c_corpse.cpp')
| -rw-r--r-- | game/client/hl2/c_corpse.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/game/client/hl2/c_corpse.cpp b/game/client/hl2/c_corpse.cpp new file mode 100644 index 0000000..fddb07e --- /dev/null +++ b/game/client/hl2/c_corpse.cpp @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: Implements C_Corpse +// +// $NoKeywords: $ +//=============================================================================// +#include "cbase.h" +#include "c_corpse.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +IMPLEMENT_CLIENTCLASS_DT(C_Corpse, DT_Corpse, CCorpse) + RecvPropInt(RECVINFO(m_nReferencePlayer)) +END_RECV_TABLE() + + + + +C_Corpse::C_Corpse() +{ + m_nReferencePlayer = 0; +} + + +int C_Corpse::DrawModel( int flags ) +{ + int drawn = 0; + if ( m_nReferencePlayer <= 0 || + m_nReferencePlayer > gpGlobals->maxClients ) + { + return drawn; + }; + + // Make sure m_pstudiohdr is valid for drawing + if ( !GetModelPtr() ) + { + return drawn; + } + + if ( !m_bReadyToDraw ) + return 0; + + // get copy of player + C_BasePlayer *player = dynamic_cast< C_BasePlayer *>( cl_entitylist->GetEnt( m_nReferencePlayer ) ); + if ( player ) + { + Vector zero; + zero.Init(); + + drawn = modelrender->DrawModel( + flags, + this, + MODEL_INSTANCE_INVALID, + m_nReferencePlayer, + GetModel(), + GetAbsOrigin(), + GetAbsAngles(), + m_nSkin, + m_nBody, + m_nHitboxSet ); + } + + return drawn; +} + |