Merge pull request #100 from SanyaSho/ent-create-crash-fix

small fixes
This commit is contained in:
nillerusr
2022-08-04 19:10:52 +03:00
committed by GitHub
19 changed files with 142 additions and 61 deletions
+1 -2
View File
@@ -4191,8 +4191,7 @@ void CGameMovement::FinishUnDuckJump( trace_t &trace )
//-----------------------------------------------------------------------------
void CGameMovement::FinishDuck( void )
{
if ( player->GetFlags() & FL_DUCKING )
return;
// if ( player->GetFlags() & FL_DUCKING ) return;
player->AddFlag( FL_DUCKING );
player->m_Local.m_bDucked = true;
+1 -1
View File
@@ -206,7 +206,7 @@ bool CHalfLife2::Damage_IsTimeBased( int iDmgType )
// Damage types that are time-based.
#ifdef HL2_EPISODIC
// This makes me think EP2 should have its own rules, but they are #ifdef all over in here.
return ( ( iDmgType & ( DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_SLOWBURN ) ) != 0 );
return ( ( iDmgType & ( DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN ) ) != 0 );
#else
return BaseClass::Damage_IsTimeBased( iDmgType );
#endif
+3 -3
View File
@@ -140,9 +140,9 @@ void CWeapon357::PrimaryAttack( void )
angles.y += random->RandomInt( -1, 1 );
angles.z = 0;
#ifndef CLIENT_DLL
pPlayer->SnapEyeAngles( angles );
#endif
//#ifndef CLIENT_DLL
// pPlayer->SnapEyeAngles( angles );
//#endif
pPlayer->ViewPunch( QAngle( -8, random->RandomFloat( -2, 2 ), 0 ) );
+29 -2
View File
@@ -261,14 +261,41 @@ void CWeaponHL2MPBase::FallInit( void )
}
SetPickupTouch();
SetThink( &CBaseCombatWeapon::FallThink );
SetThink( &CWeaponHL2MPBase::FallThink );
SetNextThink( gpGlobals->curtime + 0.1f );
#endif
}
#ifdef GAME_DLL
void CWeaponHL2MPBase::FallThink( void )
{
// Prevent the common HL2DM weapon respawn bug from happening
// When a weapon is spawned, the following chain of events occurs:
// - Spawn() is called (duh), which then calls FallInit()
// - FallInit() is called, and prepares the weapon's 'Think' function (CBaseCombatWeapon::FallThink())
// - FallThink() is called, and performs several checks before deciding whether the weapon should Materialize()
// - Materialize() is called (the HL2DM version above), which sets the weapon's respawn location.
// The problem occurs when a weapon isn't placed properly by a level designer.
// If the weapon is unable to move from its location (e.g. if its bounding box is halfway inside a wall), Materialize() never gets called.
// Since Materialize() never gets called, the weapon's respawn location is never set, so if a person picks it up, it respawns forever at
// 0 0 0 on the map (infinite loop of fall, wait, respawn, not nice at all for performance and bandwidth!)
if( HasSpawnFlags( SF_NORESPAWN ) == false )
{
if( GetOriginalSpawnOrigin() == vec3_origin )
{
m_vOriginalSpawnOrigin = GetAbsOrigin();
m_vOriginalSpawnAngles = GetAbsAngles();
}
}
return BaseClass::FallThink();
}
#endif
const CHL2MPSWeaponInfo &CWeaponHL2MPBase::GetHL2MPWpnData() const
{
const FileWeaponInfo_t *pWeaponInfo = &GetWpnData();
+3 -2
View File
@@ -40,11 +40,12 @@ public:
#ifdef GAME_DLL
DECLARE_DATADESC();
void SendReloadSoundEvent( void );
void Materialize( void );
virtual int ObjectCaps( void );
virtual int ObjectCaps( void );
virtual void FallThink( void );
#endif
// All predicted weapons need to implement and return true
+1 -1
View File
@@ -1248,7 +1248,7 @@ void CAPCMissile::ComputeActualDotPosition( CLaserDot *pLaserDot, Vector *pActua
#define RPG_BEAM_SPRITE "effects/laser1.vmt"
#define RPG_BEAM_SPRITE_NOZ "effects/laser1_noz.vmt"
#define RPG_LASER_SPRITE "sprites/redglow1"
#define RPG_LASER_SPRITE "sprites/redglow1.vmt"
//=============================================================================
// RPG
+1 -1
View File
@@ -232,7 +232,7 @@ enum CastVote
#define MAX_PLACE_NAME_LENGTH 18
#define MAX_FOV 90
#define MAX_FOV 110
//===================================================================================================================
// Team Defines