From 0f7d9d029fedcb36b96797feb6d0f82051390e09 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Wed, 3 Aug 2022 17:19:43 +0300 Subject: [PATCH 01/18] game: fix ent_create crash if entity model is NULL --- game/server/ai_basenpc.cpp | 6 ++++++ public/bone_setup.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/game/server/ai_basenpc.cpp b/game/server/ai_basenpc.cpp index 0acc458f..25fbc0c3 100644 --- a/game/server/ai_basenpc.cpp +++ b/game/server/ai_basenpc.cpp @@ -6560,6 +6560,12 @@ float CAI_BaseNPC::ThrowLimit( const Vector &vecStart, //----------------------------------------------------------------------------- void CAI_BaseNPC::SetupVPhysicsHull() { + if( GetModelPtr() == NULL ) + { + UTIL_Remove( this ); + return; + } + if ( GetMoveType() == MOVETYPE_VPHYSICS || GetMoveType() == MOVETYPE_NONE ) return; diff --git a/public/bone_setup.cpp b/public/bone_setup.cpp index 564f9ea6..8302b8f5 100644 --- a/public/bone_setup.cpp +++ b/public/bone_setup.cpp @@ -5943,6 +5943,8 @@ const char *Studio_GetDefaultSurfaceProps( CStudioHdr *pstudiohdr ) float Studio_GetMass( CStudioHdr *pstudiohdr ) { + if( pstudiohdr == NULL ) return 0.f; + return pstudiohdr->mass(); } From 4ae9719b74939039c7382eb2ccf3a03d45b1758f Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Wed, 3 Aug 2022 17:34:05 +0300 Subject: [PATCH 02/18] game: restore combine ability to play pain sounds --- game/server/hl2/npc_combine.cpp | 2 +- game/server/hl2/npc_combine.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/game/server/hl2/npc_combine.cpp b/game/server/hl2/npc_combine.cpp index 09cae88a..afd1f8e2 100644 --- a/game/server/hl2/npc_combine.cpp +++ b/game/server/hl2/npc_combine.cpp @@ -2565,7 +2565,7 @@ void CNPC_Combine::SpeakSentence( int sentenceType ) //========================================================= // PainSound //========================================================= -void CNPC_Combine::PainSound ( void ) +void CNPC_Combine::PainSound ( const CTakeDamageInfo &damageinfo ) { // NOTE: The response system deals with this at the moment if ( GetFlags() & FL_DISSOLVING ) diff --git a/game/server/hl2/npc_combine.h b/game/server/hl2/npc_combine.h index ab166723c..3cbea2a7 100644 --- a/game/server/hl2/npc_combine.h +++ b/game/server/hl2/npc_combine.h @@ -126,7 +126,7 @@ public: // Sounds // ------------- void DeathSound( void ); - void PainSound( void ); + void PainSound( const CTakeDamageInfo &damageinfo ); void IdleSound( void ); void AlertSound( void ); void LostEnemySound( void ); From 3b475331f25e1c6e89b23a4a3335d70d4ecc5c4e Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Wed, 3 Aug 2022 18:21:04 +0300 Subject: [PATCH 03/18] gameui: don`t show FOVValueLabel if fov_desired cvar is not exists --- gameui/OptionsSubVideo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gameui/OptionsSubVideo.cpp b/gameui/OptionsSubVideo.cpp index 71844f96..55b36bd1 100644 --- a/gameui/OptionsSubVideo.cpp +++ b/gameui/OptionsSubVideo.cpp @@ -448,6 +448,12 @@ public: { pFOV->SetVisible( false ); } + + pFOV = FindChildByName( "FovValueLabel" ); + if ( pFOV ) + { + pFOV->SetVisible( false ); + } } MarkDefaultSettingsAsRecommended(); From 29080d7649edfa23889ec1a55a6f6b6dd0f5bb7a Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 00:33:45 +0300 Subject: [PATCH 04/18] game: apply https://developer.valvesoftware.com/wiki/Weapon_Respawn_Fix patch --- game/shared/hl2mp/weapon_hl2mpbase.cpp | 31 ++++++++++++++++++++++++-- game/shared/hl2mp/weapon_hl2mpbase.h | 5 +++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/game/shared/hl2mp/weapon_hl2mpbase.cpp b/game/shared/hl2mp/weapon_hl2mpbase.cpp index 15995a5b..7499efae 100644 --- a/game/shared/hl2mp/weapon_hl2mpbase.cpp +++ b/game/shared/hl2mp/weapon_hl2mpbase.cpp @@ -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(); diff --git a/game/shared/hl2mp/weapon_hl2mpbase.h b/game/shared/hl2mp/weapon_hl2mpbase.h index 0f21044b..8a664d23 100644 --- a/game/shared/hl2mp/weapon_hl2mpbase.h +++ b/game/shared/hl2mp/weapon_hl2mpbase.h @@ -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 From 97794917740e1e27958d92aa3b08a7097265d2ac Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 00:48:42 +0300 Subject: [PATCH 05/18] game: fix previous commit --- game/shared/hl2mp/weapon_hl2mpbase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/hl2mp/weapon_hl2mpbase.cpp b/game/shared/hl2mp/weapon_hl2mpbase.cpp index 7499efae..90824c7c 100644 --- a/game/shared/hl2mp/weapon_hl2mpbase.cpp +++ b/game/shared/hl2mp/weapon_hl2mpbase.cpp @@ -283,7 +283,7 @@ void CWeaponHL2MPBase::FallThink( void ) // 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( HasSpawnFlags( SF_NORESPAWN ) == false ) { if( GetOriginalSpawnOrigin() == vec3_origin ) { From e8f26b4401526774ee0894538bf53afe6e742739 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 11:42:52 +0300 Subject: [PATCH 06/18] game: fix NPC blink --- game/client/c_baseflex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/client/c_baseflex.cpp b/game/client/c_baseflex.cpp index 6146b2dd..b1816840 100644 --- a/game/client/c_baseflex.cpp +++ b/game/client/c_baseflex.cpp @@ -1149,7 +1149,7 @@ void C_BaseFlex::SetupWeights( const matrix3x4_t *pBoneToWorld, int nFlexWeightC { // hack in an initialization LinkToGlobalFlexControllers( GetModelPtr() ); - m_iBlink = AddGlobalFlexController( "UH" ); + m_iBlink = AddGlobalFlexController( "blink" ); if ( SetupGlobalWeights( pBoneToWorld, nFlexWeightCount, pFlexWeights, pFlexDelayedWeights ) ) { From e0db3b1a40aa9e0e981cb55315ebeab09a0ae7c6 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 15:36:04 +0300 Subject: [PATCH 07/18] game: beta houndeye painsound fix --- game/server/hl2/npc_houndeye.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/server/hl2/npc_houndeye.cpp b/game/server/hl2/npc_houndeye.cpp index c121d11a..ecbea6a4 100644 --- a/game/server/hl2/npc_houndeye.cpp +++ b/game/server/hl2/npc_houndeye.cpp @@ -529,7 +529,7 @@ void CNPC_Houndeye::DeathSound ( void ) //========================================================= // PainSound //========================================================= -void CNPC_Houndeye::PainSound ( void ) +void CNPC_Houndeye::PainSound ( const CTakeDamageInfo &info ) { EmitSound( "NPC_Houndeye.Pain" ); } From 5caf8adbd7ab4d44a07139159ce70a29b80d71fb Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 15:53:29 +0300 Subject: [PATCH 08/18] game: don`t rotate viewmodels in zoom --- game/client/view.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/game/client/view.cpp b/game/client/view.cpp index 3c28d89a..4f3b9b4a 100644 --- a/game/client/view.cpp +++ b/game/client/view.cpp @@ -642,16 +642,17 @@ void CViewRender::SetUpViews() // Initialize view structure with default values float farZ = GetZFar(); - // Set up the mono/middle view. - CViewSetup &view = m_View; + // Set up the mono/middle view. + CViewSetup &view = m_View; - view.zFar = farZ; - view.zFarViewmodel = farZ; - // UNDONE: Make this farther out? + view.zFav = farZ; + view.zFarViewmodel = farZ; + + // UNDONE: Make this farther out? // closest point of approach seems to be view center to top of crouched box - view.zNear = GetZNear(); - view.zNearViewmodel = 1; - view.fov = default_fov.GetFloat(); + view.zNear = GetZNear(); + view.zNearViewmodel = 1; + view.fov = default_fov.GetFloat(); view.m_bOrtho = false; view.m_bViewToProjectionOverride = false; @@ -736,7 +737,7 @@ void CViewRender::SetUpViews() float flFOVOffset = fDefaultFov - view.fov; //Adjust the viewmodel's FOV to move with any FOV offsets on the viewer's end - view.fovViewmodel = g_pClientMode->GetViewModelFOV() - flFOVOffset; + view.fovViewmodel = fabs( g_pClientMode->GetViewModelFOV() - flFOVOffset ); if ( UseVR() ) { From d628a7ae802ff0444eebfc5065bbf0725935533a Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:17:51 +0300 Subject: [PATCH 09/18] game: restore combine elite soldiers ability to use alt-fire of SMG1 --- game/server/hl2/npc_combine.cpp | 15 ++++++-- game/server/hl2/weapon_smg1.cpp | 62 +++++++++++++++++++++------------ 2 files changed, 53 insertions(+), 24 deletions(-) diff --git a/game/server/hl2/npc_combine.cpp b/game/server/hl2/npc_combine.cpp index afd1f8e2..c06a6ddb 100644 --- a/game/server/hl2/npc_combine.cpp +++ b/game/server/hl2/npc_combine.cpp @@ -378,7 +378,7 @@ void CNPC_Combine::PostNPCInit() // an AR2. if( !GetActiveWeapon() || !FClassnameIs( GetActiveWeapon(), "weapon_ar2" ) ) { - DevWarning("**Combine Elite Soldier MUST be equipped with AR2\n"); + // DevWarning("**Combine Elite Soldier MUST be equipped with AR2\n"); } } @@ -2320,7 +2320,18 @@ void CNPC_Combine::HandleAnimEvent( animevent_t *pEvent ) { if ( pEvent->event == COMBINE_AE_BEGIN_ALTFIRE ) { - EmitSound( "Weapon_CombineGuard.Special1" ); + if( FClassnameIs( GetActiveWeapon(), "weapon_ar2" ) ) + { + EmitSound( "Weapon_CombineGuard.Special1" ); + } + else if( FClassnameIs( GetActiveWeapon(), "weapon_smg1" ) ) + { + EmitSound( "Weapon_SMG1.Double" ); + } + else + { + EmitSound( "Weapon_CombineGuard.Special1" ); + } handledEvent = true; } else if ( pEvent->event == COMBINE_AE_ALTFIRE ) diff --git a/game/server/hl2/weapon_smg1.cpp b/game/server/hl2/weapon_smg1.cpp index cc9934a4..4515ad08 100644 --- a/game/server/hl2/weapon_smg1.cpp +++ b/game/server/hl2/weapon_smg1.cpp @@ -45,7 +45,7 @@ public: float GetFireRate( void ) { return 0.075f; } // 13.3hz int CapabilitiesGet( void ) { return bits_CAP_WEAPON_RANGE_ATTACK1; } - int WeaponRangeAttack2Condition( float flDot, float flDist ); + int WeaponRangeAttack2Condition(/* float flDot, float flDist */); Activity GetPrimaryAttackActivity( void ); virtual const Vector& GetBulletSpread( void ) @@ -228,32 +228,50 @@ void CWeaponSMG1::Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatChar } break; - /*//FIXME: Re-enable - case EVENT_WEAPON_AR2_GRENADE: + case EVENT_WEAPON_AR2_ALTFIRE: { - CAI_BaseNPC *npc = pOperator->MyNPCPointer(); + CAI_BaseNPC *npc = pOperator->MyNPCPointer(); + + Vector vecShootOrigin, vecShootDir; + vecShootOrigin = pOperator->Weapon_ShootPosition(); + //vecShootDir = npc->GetShootEnemyDir( vecShootOrigin ); + + //Checks if it can fire the grenade + WeaponRangeAttack2Condition(); + + Vector vecThrow = m_vecTossVelocity; + + //If on the rare case the vector is 0 0 0, cancel for avoid launching the grenade without speed + //This should be on WeaponRangeAttack2Condition(), but for some unknown reason return CASE_NONE + //doesn't stop the launch + if( vecThrow == Vector(0, 0, 0) ) + { + break; + } - Vector vecShootOrigin, vecShootDir; - vecShootOrigin = pOperator->Weapon_ShootPosition(); - vecShootDir = npc->GetShootEnemyDir( vecShootOrigin ); + CGrenadeAR2 *pGrenade = (CGrenadeAR2*)Create("grenade_ar2", vecShootOrigin, vec3_angle, npc); + pGrenade->SetAbsVelocity( vecThrow ); + pGrenade->SetLocalAngularVelocity(RandomAngle(-400, 400)); //tumble in air + pGrenade->SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE ); - Vector vecThrow = m_vecTossVelocity; + pGrenade->SetThrower(GetOwner()); - CGrenadeAR2 *pGrenade = (CGrenadeAR2*)Create( "grenade_ar2", vecShootOrigin, vec3_angle, npc ); - pGrenade->SetAbsVelocity( vecThrow ); - pGrenade->SetLocalAngularVelocity( QAngle( 0, 400, 0 ) ); - pGrenade->SetMoveType( MOVETYPE_FLYGRAVITY ); - pGrenade->m_hOwner = npc; - pGrenade->m_pMyWeaponAR2 = this; - pGrenade->SetDamage(sk_npc_dmg_ar2_grenade.GetFloat()); + pGrenade->SetGravity(0.5); // lower gravity since grenade is aerodynamic and engine doesn't know it. - // FIXME: arrgg ,this is hard coded into the weapon??? - m_flNextGrenadeCheck = gpGlobals->curtime + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + pGrenade->SetDamage( sk_plr_dmg_smg1_grenade.GetFloat() ); - m_iClip2--; + if( g_pGameRules->IsSkillLevel( SKILL_HARD ) ) + { + m_flNextGrenadeCheck = gpGlobals->curtime + RandomFloat(2, 3); + } + else + { + m_flNextGrenadeCheck = gpGlobals->curtime + 6;// wait six seconds before even looking again to see if a grenade can be thrown. + } + + m_iClip2--; } break; - */ default: BaseClass::Operator_HandleAnimEvent( pEvent, pOperator ); @@ -272,7 +290,7 @@ Activity CWeaponSMG1::GetPrimaryAttackActivity( void ) if ( m_nShotsFired < 3 ) return ACT_VM_RECOIL1; - + if ( m_nShotsFired < 4 ) return ACT_VM_RECOIL2; @@ -394,11 +412,11 @@ void CWeaponSMG1::SecondaryAttack( void ) // flDist - // Output : int //----------------------------------------------------------------------------- -int CWeaponSMG1::WeaponRangeAttack2Condition( float flDot, float flDist ) +int CWeaponSMG1::WeaponRangeAttack2Condition(/* float flDot, float flDist */) { CAI_BaseNPC *npcOwner = GetOwner()->MyNPCPointer(); - return COND_NONE; + // return COND_NONE; /* // -------------------------------------------------------- From ccf0357a513ee2ae9fd3f93113f0efb38c47b183 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:27:21 +0300 Subject: [PATCH 10/18] game: restore dropship ability to shoot with rotsting gun --- game/server/hl2/npc_combinedropship.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/game/server/hl2/npc_combinedropship.cpp b/game/server/hl2/npc_combinedropship.cpp index ffe1befd..37f2ea75 100644 --- a/game/server/hl2/npc_combinedropship.cpp +++ b/game/server/hl2/npc_combinedropship.cpp @@ -343,6 +343,8 @@ private: int m_iMachineGunRefAttachment; int m_iAttachmentTroopDeploy; int m_iAttachmentDeployStart; + int m_poseWeapon_Pitch; + int m_poseWeapon_Yaw; // Sounds CSoundPatch *m_pCannonSound; @@ -363,8 +365,7 @@ protected: // Should the dropship end up having inheritors, their activate may // stomp these numbers, in which case you should make these ordinary members // again. - static int m_poseBody_Accel, m_poseBody_Sway, m_poseCargo_Body_Accel, m_poseCargo_Body_Sway, - m_poseWeapon_Pitch, m_poseWeapon_Yaw; + static int m_poseBody_Accel, m_poseBody_Sway, m_poseCargo_Body_Accel, m_poseCargo_Body_Sway; static bool m_sbStaticPoseParamsLoaded; virtual void PopulatePoseParameters( void ); }; @@ -375,13 +376,11 @@ int CNPC_CombineDropship::m_poseBody_Accel = 0; int CNPC_CombineDropship::m_poseBody_Sway = 0; int CNPC_CombineDropship::m_poseCargo_Body_Accel = 0; int CNPC_CombineDropship::m_poseCargo_Body_Sway = 0; -int CNPC_CombineDropship::m_poseWeapon_Pitch = 0; -int CNPC_CombineDropship::m_poseWeapon_Yaw = 0; //----------------------------------------------------------------------------- // Purpose: Cache whatever pose parameters we intend to use //----------------------------------------------------------------------------- -void CNPC_CombineDropship::PopulatePoseParameters( void ) +void CNPC_CombineDropship::PopulatePoseParameters( void ) { if (!m_sbStaticPoseParamsLoaded) { @@ -389,12 +388,16 @@ void CNPC_CombineDropship::PopulatePoseParameters( void ) m_poseBody_Sway = LookupPoseParameter( "body_sway" ); m_poseCargo_Body_Accel = LookupPoseParameter( "cargo_body_accel" ); m_poseCargo_Body_Sway = LookupPoseParameter( "cargo_body_sway" ); - m_poseWeapon_Pitch = LookupPoseParameter( "weapon_pitch" ); - m_poseWeapon_Yaw = LookupPoseParameter( "weapon_yaw" ); m_sbStaticPoseParamsLoaded = true; } + if( m_hContainer ) + { + m_poseWeapon_Pitch = m_hContainer->LookupPoseParameter( "weapon_pitch" ); + m_poseWeapon_Yaw = m_hContainer->LookupPoseParameter( "weapon_yaw" ); + } + BaseClass::PopulatePoseParameters(); } @@ -861,6 +864,8 @@ void CNPC_CombineDropship::Spawn( void ) m_iMachineGunRefAttachment = -1; m_iAttachmentTroopDeploy = -1; m_iAttachmentDeployStart = -1; + m_poseWeapon_Pitch = -1; + m_poseWeapon_Yaw = -1; // create the correct bin for the ship to carry switch ( m_iCrateType ) @@ -896,6 +901,9 @@ void CNPC_CombineDropship::Spawn( void ) m_iMachineGunBaseAttachment = m_hContainer->LookupAttachment( "gun_base" ); // NOTE: gun_ref must have the same position as gun_base, but rotates with the gun m_iMachineGunRefAttachment = m_hContainer->LookupAttachment( "gun_ref" ); + + m_poseWeapon_Pitch = m_hContainer->LookupPoseParameter( "weapon_pitch" ); + m_poseWeapon_Yaw = m_hContainer->LookupPoseParameter( "weapon_yaw" ); } break; From e6901ffadf3edce4571d7f88f4b794abe1e79386 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:29:21 +0300 Subject: [PATCH 11/18] game: fix acid damage white flash bug --- game/shared/hl2/hl2_gamerules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/hl2/hl2_gamerules.cpp b/game/shared/hl2/hl2_gamerules.cpp index cf7dd629..781a37fd 100644 --- a/game/shared/hl2/hl2_gamerules.cpp +++ b/game/shared/hl2/hl2_gamerules.cpp @@ -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 From e8ffb402de8df6faa02fb8c3f0e10ce35a85f740 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:30:30 +0300 Subject: [PATCH 12/18] game: quantum crouch fix --- game/shared/gamemovement.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/game/shared/gamemovement.cpp b/game/shared/gamemovement.cpp index 8de6fc32..6258459a 100644 --- a/game/shared/gamemovement.cpp +++ b/game/shared/gamemovement.cpp @@ -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; From 38209fe326396b30d4acd8496c4ae56f75a5fd9a Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:42:23 +0300 Subject: [PATCH 13/18] fix game: don`t rotate viewmodels in zoom --- game/client/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/client/view.cpp b/game/client/view.cpp index 4f3b9b4a..3aa035b2 100644 --- a/game/client/view.cpp +++ b/game/client/view.cpp @@ -645,7 +645,7 @@ void CViewRender::SetUpViews() // Set up the mono/middle view. CViewSetup &view = m_View; - view.zFav = farZ; + view.zFar = farZ; view.zFarViewmodel = farZ; // UNDONE: Make this farther out? From 6c42a04f8a0f6084a4b7a297de032960904f272f Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:47:14 +0300 Subject: [PATCH 14/18] game: fix env_sun sprite disappearing when you look at it --- game/client/glow_overlay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/client/glow_overlay.cpp b/game/client/glow_overlay.cpp index 72915e3c..3e63fb36 100644 --- a/game/client/glow_overlay.cpp +++ b/game/client/glow_overlay.cpp @@ -159,7 +159,7 @@ void CGlowOverlay::UpdateSkyGlowObstruction( float zFar, bool bCacheFullSceneSta if ( PixelVisibility_IsAvailable() ) { // Trace a ray at the object. - Vector pos = CurrentViewOrigin() + m_vDirection * zFar * 0.999f; + Vector pos = CurrentViewOrigin() + m_vDirection * zFar * 0.99f; //9f; // UNDONE: Can probably do only the pixelvis query in this case if you can figure out where // to put it - or save the position of this trace From d958e12dbd619744fb1a61cb19eb3517224ade21 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:48:47 +0300 Subject: [PATCH 15/18] game: set MAX_FOV value to 110 --- game/shared/shareddefs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/shareddefs.h b/game/shared/shareddefs.h index 842d2f06..4b41d00a 100644 --- a/game/shared/shareddefs.h +++ b/game/shared/shareddefs.h @@ -232,7 +232,7 @@ enum CastVote #define MAX_PLACE_NAME_LENGTH 18 -#define MAX_FOV 90 +#define MAX_FOV 110 //=================================================================================================================== // Team Defines From 31c5944b5ecfb30bacf78b8060b7f5d20394662b Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:54:21 +0300 Subject: [PATCH 16/18] game: fix rpg laser sprite precache in hl2mp --- game/shared/hl2mp/weapon_rpg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/shared/hl2mp/weapon_rpg.cpp b/game/shared/hl2mp/weapon_rpg.cpp index aa3cc8fd..34ca3398 100644 --- a/game/shared/hl2mp/weapon_rpg.cpp +++ b/game/shared/hl2mp/weapon_rpg.cpp @@ -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 From b525e49d6fb82291b28cfa0363faf35a53b60586 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 16:58:02 +0300 Subject: [PATCH 17/18] game: fix 357 crosshair in hl2mp --- game/shared/hl2mp/weapon_357.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game/shared/hl2mp/weapon_357.cpp b/game/shared/hl2mp/weapon_357.cpp index d943f278..3d496989 100644 --- a/game/shared/hl2mp/weapon_357.cpp +++ b/game/shared/hl2mp/weapon_357.cpp @@ -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 ) ); From 448b3538448fdd9613e59bd1eb5e3e5088ae4448 Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Thu, 4 Aug 2022 17:01:54 +0300 Subject: [PATCH 18/18] game: grenade trail fix --- game/server/hl2/grenade_frag.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/game/server/hl2/grenade_frag.cpp b/game/server/hl2/grenade_frag.cpp index 1788d191..f3232798 100644 --- a/game/server/hl2/grenade_frag.cpp +++ b/game/server/hl2/grenade_frag.cpp @@ -155,9 +155,10 @@ void CGrenadeFrag::OnRestore( void ) void CGrenadeFrag::CreateEffects( void ) { // Start up the eye glow - m_pMainGlow = CSprite::SpriteCreate( "sprites/redglow1.vmt", GetLocalOrigin(), false ); + if( !m_pMainGlow ) + m_pMainGlow = CSprite::SpriteCreate( "sprites/redglow1.vmt", GetLocalOrigin(), false ); - int nAttachment = LookupAttachment( "fuse" ); + int nAttachment = LookupAttachment( "fuse" ); if ( m_pMainGlow != NULL ) { @@ -169,7 +170,8 @@ void CGrenadeFrag::CreateEffects( void ) } // Start up the eye trail - m_pGlowTrail = CSpriteTrail::SpriteTrailCreate( "sprites/bluelaser1.vmt", GetLocalOrigin(), false ); + if( !m_pGlowTrail ) + m_pGlowTrail = CSpriteTrail::SpriteTrailCreate( "sprites/bluelaser1.vmt", GetLocalOrigin(), false ); if ( m_pGlowTrail != NULL ) { @@ -450,4 +452,4 @@ bool Fraggrenade_WasCreatedByCombine( const CBaseEntity *pEntity ) } return false; -} \ No newline at end of file +}