Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions src/game/client/c_baseanimating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3271,18 +3271,10 @@ int C_BaseAnimating::DrawModel( int flags )
auto pTargetPlayer = C_NEO_Player::GetVisionTargetNEOPlayer();
const bool inMotionVision = pTargetPlayer->IsInVision() && pTargetPlayer->GetClass() == NEO_CLASS_ASSAULT;
auto rootMoveParent = GetRootMoveParent();
Vector vel;
if (IsRagdoll())
Vector vel = rootMoveParent->GetAbsVelocity();
if (vel == vec3_origin)
{
vel = m_pRagdoll->m_vecLastVelocity;
}
else
{
vel = rootMoveParent->GetAbsVelocity();
if (vel == vec3_origin)
{
rootMoveParent->EstimateAbsVelocity(vel);
}
rootMoveParent->EstimateAbsVelocity(vel);
}
bool isMoving = false;
bool isHot = false;
Expand Down
24 changes: 16 additions & 8 deletions src/game/client/hl2mp/c_hl2mp_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,9 @@ IMPLEMENT_CLIENTCLASS_DT_NOBASE( C_HL2MPRagdoll, DT_HL2MPRagdoll, CHL2MPRagdoll
RecvPropInt( RECVINFO(m_nForceBone) ),
RecvPropVector( RECVINFO(m_vecForce) ),
RecvPropVector( RECVINFO( m_vecRagdollVelocity ) )
#ifdef NEO
,RecvPropInt(RECVINFO(m_iRagdollModel))
#endif // NEO
END_RECV_TABLE()


Expand All @@ -1241,6 +1244,7 @@ C_HL2MPRagdoll::C_HL2MPRagdoll()
{
#ifdef NEO
m_flNeoCreateTime = gpGlobals->curtime;
m_iRagdollModel = -1;
#endif // NEO
}

Expand Down Expand Up @@ -1321,7 +1325,12 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )
// then we can make ourselves start out exactly where the player is.
C_HL2MP_Player *pPlayer = dynamic_cast< C_HL2MP_Player* >( m_hPlayer.Get() );

#ifdef NEO
SetModelIndex(m_iRagdollModel ? m_iRagdollModel : m_nModelIndex);
if ( pPlayer )
#else
if ( pPlayer && !pPlayer->IsDormant() )
#endif // NEO
{
// move my current model instance to the ragdoll's so decals are preserved.
pPlayer->SnatchModelInstance( this );
Expand All @@ -1330,8 +1339,10 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )

// Copy all the interpolated vars from the player entity.
// The entity uses the interpolated history to get bone velocity.
#ifndef NEO
bool bRemotePlayer = (pPlayer != C_BasePlayer::GetLocalPlayer());
if ( bRemotePlayer )
#endif // NEO
{
Interp_Copy( pPlayer );

Expand All @@ -1342,6 +1353,7 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )
SetSequence( pPlayer->GetSequence() );
m_flPlaybackRate = pPlayer->GetPlaybackRate();
}
#ifndef NEO
else
{
// This is the local player, so set them in a default
Expand All @@ -1363,7 +1375,8 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )
SetCycle( 0.0 );

Interp_Reset( varMap );
}
}
#endif // NEO
}
else
{
Expand All @@ -1378,7 +1391,9 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )

}

#ifndef NEO
SetModelIndex( m_nModelIndex );
#endif // NEO

// Make us a ragdoll..
m_nRenderFX = kRenderFxRagdoll;
Expand Down Expand Up @@ -1406,13 +1421,6 @@ void C_HL2MPRagdoll::CreateHL2MPRagdoll( void )
}

InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
#ifdef NEO
if (m_pRagdoll)
{
m_pRagdoll->SetInitialVelocity(GetInitialRagdollVelocity());
m_pRagdoll->SetLastOrigin(GetInitialRagdollOrigin());
}
#endif // NEO
}


Expand Down
4 changes: 4 additions & 0 deletions src/game/client/hl2mp/c_hl2mp_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ class C_HL2MPRagdoll : public C_BaseAnimatingOverlay
EHANDLE m_hPlayer;
CNetworkVector( m_vecRagdollVelocity );
CNetworkVector( m_vecRagdollOrigin );
public:
#ifdef NEO
CNetworkVar(int, m_iRagdollModel);
#endif // NEO
};

#endif //HL2MP_PLAYER_H
6 changes: 1 addition & 5 deletions src/game/client/neo/c_neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1962,11 +1962,7 @@ void C_NEO_Player::PreDataUpdate(DataUpdateType_t updateType)
{
if (updateType == DATA_UPDATE_DATATABLE_CHANGED)
{
if (gpGlobals->tickcount - m_nVisionLastTick < TIME_TO_TICKS(0.1f))
{
return;
}
else
if (gpGlobals->tickcount - m_nVisionLastTick >= TIME_TO_TICKS(0.1f))
{
m_bIsAllowedToToggleVision = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/client/neo/ui/neo_hud_friendly_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include "neo_gamerules.h"
#include "c_neo_player.h"

#include "c_playerresource.h"
#include "c_team.h"

// memdbgon must be the last include file in a .cpp file!!!
Expand Down Expand Up @@ -179,7 +179,7 @@ void CNEOHud_FriendlyMarker::DrawPlayerForTeam(C_Team *team, const C_NEO_Player
for (int i = 0; i < memberCount; ++i)
{
auto player = static_cast<C_NEO_Player *>(team->GetPlayer(i));
if (player && localPlayer->entindex() != player->entindex() && player->IsAlive())
if (player && localPlayer->entindex() != player->entindex() && g_PR->IsAlive(player->entindex()))
{
if (pTargetPlayer && player->entindex() == pTargetPlayer->entindex())
{
Expand Down
9 changes: 1 addition & 8 deletions src/game/client/proxyplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,7 @@ void CEntitySpeedProxy::OnBind( void *pC_BaseEntity )
C_BaseAnimating *baseAnimating = pEntity->GetBaseAnimating();
C_BaseEntity *rootMoveParent = pEntity->GetRootMoveParent();
Vector velocity = vec3_origin;
if (baseAnimating && baseAnimating->IsRagdoll())
{
velocity = baseAnimating->m_pRagdoll->m_vecLastVelocity;
}
else
{
rootMoveParent->EstimateAbsVelocity(velocity);
}
rootMoveParent->EstimateAbsVelocity(velocity);
m_pResult->SetFloatValue(velocity.Length());
#else
m_pResult->SetFloatValue( pEntity->GetLocalVelocity().Length() );
Expand Down
9 changes: 0 additions & 9 deletions src/game/client/ragdoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,6 @@ bool CRagdoll::TransformVectorToWorld(int iBoneIndex, const Vector *vPosition, V
//-----------------------------------------------------------------------------
void CRagdoll::PhysForceRagdollToSleep()
{
#ifdef NEO
m_vecLastVelocity = vec3_origin;
#endif // NEO
for ( int i = 0; i < m_ragdoll.listCount; i++ )
{
if ( m_ragdoll.list[i].pObject )
Expand All @@ -276,12 +273,6 @@ static ConVar ragdoll_sleepaftertime( "ragdoll_sleepaftertime", "5.0f", 0, "Afte
void CRagdoll::CheckSettleStationaryRagdoll()
{
Vector delta = GetRagdollOrigin() - m_vecLastOrigin;
#ifdef NEO
if (gpGlobals->frametime > 0)
{
m_vecLastVelocity = delta / (gpGlobals->frametime);
}
#endif // NEO
m_vecLastOrigin = GetRagdollOrigin();
for ( int i = 0; i < 3; ++i )
{
Expand Down
11 changes: 0 additions & 11 deletions src/game/client/ragdoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ class CRagdoll : public IRagdoll
void ResetRagdollSleepAfterTime( void );
float GetLastVPhysicsUpdateTime() const { return m_lastUpdate; }

#ifdef NEO
void SetInitialVelocity(const Vector& velocity) { m_vecInitialVelocity = velocity; }
void SetLastOrigin(const Vector& velocity) { m_vecLastOrigin = velocity; }

#endif // NEO
private:

void CheckSettleStationaryRagdoll();
Expand All @@ -106,12 +101,6 @@ class CRagdoll : public IRagdoll
bool m_allAsleep;
Vector m_vecLastOrigin;
float m_flLastOriginChangeTime;
#ifdef NEO
public:
Vector m_vecLastVelocity;
private:
Vector m_vecInitialVelocity;
#endif // NEO

#if RAGDOLL_VISUALIZE
matrix3x4_t m_savedBone1[MAXSTUDIOBONES];
Expand Down
22 changes: 20 additions & 2 deletions src/game/server/hl2mp/hl2mp_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,9 @@ class CHL2MPRagdoll : public CBaseAnimatingOverlay
CNetworkHandle( CBaseEntity, m_hPlayer ); // networked entity handle
CNetworkVector( m_vecRagdollVelocity );
CNetworkVector( m_vecRagdollOrigin );
#ifdef NEO
CNetworkVar(int, m_iRagdollModel)
#endif // NEO
};

LINK_ENTITY_TO_CLASS( hl2mp_ragdoll, CHL2MPRagdoll );
Expand All @@ -1256,6 +1259,9 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CHL2MPRagdoll, DT_HL2MPRagdoll )
SendPropInt ( SENDINFO(m_nForceBone), 8, 0 ),
SendPropVector ( SENDINFO(m_vecForce), -1, SPROP_NOSCALE ),
SendPropVector( SENDINFO( m_vecRagdollVelocity ) )
#ifdef NEO
,SendPropInt ( SENDINFO(m_iRagdollModel))
#endif // NEO
END_SEND_TABLE()


Expand Down Expand Up @@ -1291,6 +1297,18 @@ void CHL2MP_Player::CreateRagdollEntity( void )
m_hRagdoll = pRagdoll;
}

#ifdef NEO
void CHL2MP_Player::SetRagdollModel( const int modelIndex )
{
CHL2MPRagdoll *pRagdoll = dynamic_cast< CHL2MPRagdoll* >( m_hRagdoll.Get() );

if ( pRagdoll )
{
pRagdoll->m_iRagdollModel = modelIndex;
}
}
#endif // NEO

//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int CHL2MP_Player::FlashlightIsOn( void )
Expand Down Expand Up @@ -1390,6 +1408,7 @@ void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info )

BaseClass::Event_Killed( subinfo );

#ifndef NEO
if ( info.GetDamageType() & DMG_DISSOLVE )
{
if ( m_hRagdoll )
Expand All @@ -1409,10 +1428,9 @@ void CHL2MP_Player::Event_Killed( const CTakeDamageInfo &info )
iScoreToAdd = -1;
}

#ifndef NEO
GetGlobalTeam( pAttacker->GetTeamNumber() )->AddScore( iScoreToAdd );
#endif
}
#endif

FlashlightTurnOff();

Expand Down
3 changes: 3 additions & 0 deletions src/game/server/hl2mp/hl2mp_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ class CHL2MP_Player : public CHL2_Player

// Tracks our ragdoll entity.
CNetworkHandle( CBaseEntity, m_hRagdoll ); // networked entity handle
#ifdef NEO
void SetRagdollModel(const int modelIndex);
#endif // NEO

virtual bool CanHearAndReadChatFrom( CBasePlayer *pPlayer );

Expand Down
10 changes: 5 additions & 5 deletions src/game/server/neo/neo_model_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static inline int GetTeamArrOffset(int iTeam)

// Returns a third person corpse, or if defined, a related gib body part.
const char* CNEOModelManager::GetCorpseModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGib nGib) const
int iTeam, NeoGib nGib)
{
if (nClass == NEO_CLASS_VIP)
{
Expand All @@ -509,7 +509,7 @@ const char* CNEOModelManager::GetCorpseModel(NeoSkin nSkin, NeoClass nClass,

// Returns a gib body part.
const char* CNEOModelManager::GetGibModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGibLimb nGib) const
int iTeam, NeoGibLimb nGib)
{
// NEO FIXME (Rain): Shouldn't we get the "models/nt/vipgib..." variants here?
if (nClass == NEO_CLASS_VIP)
Expand Down Expand Up @@ -541,7 +541,7 @@ const char* CNEOModelManager::GetGibModel(NeoSkin nSkin, NeoClass nClass,
// Returns a third person player model.
// NEO FIXME (Rain): this is sometimes off. Are we indexing incorrectly, or is the cvar logic flawed?
const char *CNEOModelManager::GetPlayerModel(NeoSkin nSkin,
NeoClass nClass, int iTeam) const
NeoClass nClass, int iTeam)
{
if (nClass == NEO_CLASS_VIP)
{
Expand Down Expand Up @@ -586,7 +586,7 @@ const char *CNEOModelManager::GetPlayerModel(NeoSkin nSkin,
}

// Returns a first person view model.
const char *CNEOModelManager::GetViewModel(NeoViewmodel nWepVm, int iTeam) const
const char *CNEOModelManager::GetViewModel(NeoViewmodel nWepVm, int iTeam)
{
if (nWepVm == NEO_VM_VIP_SMAC)
{
Expand All @@ -605,7 +605,7 @@ const char *CNEOModelManager::GetViewModel(NeoViewmodel nWepVm, int iTeam) const
}

// Returns a third person weapon model.
const char *CNEOModelManager::GetWeaponModel(NeoWeaponModel nWep) const
const char *CNEOModelManager::GetWeaponModel(NeoWeaponModel nWep)
{
if (nWep < 0 || nWep >= ARRAYSIZE(weapons))
{
Expand Down
16 changes: 8 additions & 8 deletions src/game/server/neo/neo_model_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ class CNEOModelManager

void Precache(void) const;

const char *GetCorpseModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGib nGib = NEO_GIB_ALL) const;
static const char *GetCorpseModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGib nGib = NEO_GIB_ALL);

const char* GetGibModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGibLimb nGib = NEO_GIB_LIMB_HEAD) const;
static const char* GetGibModel(NeoSkin nSkin, NeoClass nClass,
int iTeam, NeoGibLimb nGib = NEO_GIB_LIMB_HEAD);

const char *GetPlayerModel(NeoSkin nSkin,
NeoClass nClass, int iTeam) const;
static const char *GetPlayerModel(NeoSkin nSkin,
NeoClass nClass, int iTeam);

const char *GetViewModel(NeoViewmodel nWepVm, int iTeam = TEAM_JINRAI) const;
static const char *GetViewModel(NeoViewmodel nWepVm, int iTeam = TEAM_JINRAI);

const char *GetWeaponModel(NeoWeaponModel nWep) const;
static const char *GetWeaponModel(NeoWeaponModel nWep);

private:
// We are singleton
Expand Down
Loading