Skip to content
Merged
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
23 changes: 21 additions & 2 deletions src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,13 +2046,13 @@ void CNEO_Player::SetDeadModel(const CTakeDamageInfo& info)
{
for (int i = 0; i < NEO_GIB_LIMB__ENUM_COUNT; i++)
{
CGib::SpawnSpecificGibs(this, 1, 10, 1000, modelManager->GetGibModel((NeoSkin)GetSkin(), (NeoClass)GetClass(), GetTeamNumber(), NeoGibLimb(i)));
SpawnSpecificGibs(10, 1000, modelManager->GetGibModel((NeoSkin)GetSkin(), (NeoClass)GetClass(), GetTeamNumber(), NeoGibLimb(i)));
}
UTIL_BloodSpray(info.GetDamagePosition(), info.GetDamageForce(), BLOOD_COLOR_RED, 10, FX_BLOODSPRAY_ALL);
}
else
{
CGib::SpawnSpecificGibs(this, 1, 10, 1000, modelManager->GetGibModel((NeoSkin)GetSkin(), (NeoClass)GetClass(), GetTeamNumber(), NeoGibLimb(deadModelType-1)));
SpawnSpecificGibs(10, 1000, modelManager->GetGibModel((NeoSkin)GetSkin(), (NeoClass)GetClass(), GetTeamNumber(), NeoGibLimb(deadModelType - 1)));
UTIL_BloodSpray(info.GetDamagePosition(), info.GetDamageForce(), BLOOD_COLOR_RED, 10, FX_BLOODSPRAY_GORE | FX_BLOODSPRAY_DROPS);
}
SetPlayerCorpseModel(deadModelType);
Expand Down Expand Up @@ -2082,6 +2082,25 @@ void CNEO_Player::SetPlayerCorpseModel(int type)
}
}

void CNEO_Player::SpawnSpecificGibs(float vMinVelocity, float vMaxVelocity, const char* cModelName)
{
CGib* pGib = CREATE_ENTITY(CGib, "gib");

if (NEORules()->CanRespawnAnyTime())
{
constexpr float GIB_LIFETIME = 30.f;
pGib->Spawn(cModelName, GIB_LIFETIME);
}
else
{
pGib->Spawn(cModelName);
}

pGib->m_nBody = 0;
pGib->InitGib(this, vMinVelocity, vMaxVelocity);
pGib->SetOwnerEntity(this);
}

float CNEO_Player::GetReceivedDamageScale(CBaseEntity* pAttacker)
{
if ((NEORules()->GetGameType() == NEO_GAME_TYPE_TDM || NEORules()->GetGameType() == NEO_GAME_TYPE_DM)
Expand Down
1 change: 1 addition & 0 deletions src/game/server/neo/neo_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class CNEO_Player : public CHL2MP_Player
void SetPlayerTeamModel(void);
void SetDeadModel(const CTakeDamageInfo& info);
void SetPlayerCorpseModel(int type);
void SpawnSpecificGibs(float vMinVelocity, float vMaxVelocity, const char* cModelName);
virtual void PickDefaultSpawnTeam(void) OVERRIDE;

virtual bool StartObserverMode(int mode) OVERRIDE;
Expand Down
4 changes: 2 additions & 2 deletions src/game/shared/neo/neo_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4060,12 +4060,12 @@ inline const char* CNEORules::GetGameTypeName(void)
return NEO_GAME_TYPE_SETTINGS[GetGameType()].gameTypeName;
}

inline const bool CNEORules::CanChangeTeamClassLoadoutWhenAlive()
bool CNEORules::CanChangeTeamClassLoadoutWhenAlive()
{
return NEO_GAME_TYPE_SETTINGS[GetGameType()].changeTeamClassLoadoutWhenAlive;
}

inline const bool CNEORules::CanRespawnAnyTime()
bool CNEORules::CanRespawnAnyTime()
{
return NEO_GAME_TYPE_SETTINGS[GetGameType()].respawns;
}
Expand Down
4 changes: 2 additions & 2 deletions src/game/shared/neo/neo_gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ class CNEORules : public CHL2MPRules, public CGameEventListener
int GetForcedSkin();
int GetForcedWeapon();
virtual const char* GetGameTypeName(void) OVERRIDE;
virtual const bool CanChangeTeamClassLoadoutWhenAlive();
virtual const bool CanRespawnAnyTime();
bool CanChangeTeamClassLoadoutWhenAlive();
bool CanRespawnAnyTime();

void GetDMHighestScorers(
#ifdef GAME_DLL
Expand Down
5 changes: 3 additions & 2 deletions src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extern ConVar weaponstay;
#include "c_neo_player.h"
#else
#include "items.h"
#include "neo_gamerules.h"
#endif // CLIENT_DLL

#include "basecombatweapon_shared.h"
Expand Down Expand Up @@ -1276,8 +1277,8 @@ void CNEOBaseCombatWeapon::SetPickupTouch(void)
return;
}

if (!weaponstay.GetBool())
{
if (!weaponstay.GetBool() || NEORules()->CanRespawnAnyTime())
{ // regardless of the value of mp_weaponstay, disappear weapons in game modes with respawns enabled. Otherwise things can get too chaotic
BaseClass::SetPickupTouch();
return;
}
Expand Down
Loading