From daa4779978a1def63b5f781b11708e26bbf88b7d Mon Sep 17 00:00:00 2001 From: Blixibon Date: Tue, 26 Apr 2022 08:04:54 -0500 Subject: [PATCH] Small fixes for issues of various sizes --- sp/src/game/server/ai_motor.cpp | 1 + sp/src/game/server/basecombatcharacter.cpp | 1 - sp/src/game/server/baseentity.cpp | 2 +- sp/src/game/server/hl2/npc_combine.cpp | 2 +- sp/src/game/server/hl2/npc_metropolice.cpp | 2 +- sp/src/game/server/hl2/weapon_sniperrifle.cpp | 2 +- sp/src/game/server/player.cpp | 1 + sp/src/game/shared/baseviewmodel_shared.cpp | 2 +- sp/src/game/shared/takedamageinfo.h | 4 ++-- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sp/src/game/server/ai_motor.cpp b/sp/src/game/server/ai_motor.cpp index 87a8ec6e..43eb86a3 100644 --- a/sp/src/game/server/ai_motor.cpp +++ b/sp/src/game/server/ai_motor.cpp @@ -845,6 +845,7 @@ void CAI_Motor::MoveFacing( const AILocalMoveGoal_t &move ) { // Don't let the facing queue interfere with arrival direction in important cases dir = move.facing; + VectorNormalize( dir ); } else #endif diff --git a/sp/src/game/server/basecombatcharacter.cpp b/sp/src/game/server/basecombatcharacter.cpp index f4b35392..5ea5c65d 100644 --- a/sp/src/game/server/basecombatcharacter.cpp +++ b/sp/src/game/server/basecombatcharacter.cpp @@ -2789,7 +2789,6 @@ Activity CBaseCombatCharacter::Weapon_BackupActivity( Activity activity, bool we if (pTable && GetModelPtr()) { - int actCount = pWeapon->GetBackupActivityListCount(); return Weapon_BackupActivityFromList( this, pTable, actCount, activity, weaponTranslationWasRequired, pWeapon ); } diff --git a/sp/src/game/server/baseentity.cpp b/sp/src/game/server/baseentity.cpp index 42f857de..5e47d89e 100644 --- a/sp/src/game/server/baseentity.cpp +++ b/sp/src/game/server/baseentity.cpp @@ -7707,7 +7707,7 @@ bool CBaseEntity::HasContext( const char *name, const char *value ) const if (value == NULL) return true; else - return Matcher_Match(STRING(m_ResponseContexts[i].m_iszValue), value); + return Matcher_Match( value, STRING(m_ResponseContexts[i].m_iszValue) ); } } diff --git a/sp/src/game/server/hl2/npc_combine.cpp b/sp/src/game/server/hl2/npc_combine.cpp index 50d10982..73bac242 100644 --- a/sp/src/game/server/hl2/npc_combine.cpp +++ b/sp/src/game/server/hl2/npc_combine.cpp @@ -2719,7 +2719,7 @@ void CNPC_Combine::HandleAnimEvent( animevent_t *pEvent ) else if ( pEvent->event == COMBINE_AE_ALTFIRE ) { #ifdef MAPBASE - if ( IsAltFireCapable() ) + if ( IsAltFireCapable() && GetActiveWeapon() ) #else if ( IsElite() ) #endif diff --git a/sp/src/game/server/hl2/npc_metropolice.cpp b/sp/src/game/server/hl2/npc_metropolice.cpp index 229db7b0..5f6151c4 100644 --- a/sp/src/game/server/hl2/npc_metropolice.cpp +++ b/sp/src/game/server/hl2/npc_metropolice.cpp @@ -1539,7 +1539,7 @@ void CNPC_MetroPolice::OnUpdateShotRegulator( ) // FIXME: This code (except the burst interval) could be used for all weapon types #ifdef MAPBASE // Only if we actually have the pistol out - if ( EntIsClass( GetActiveWeapon(), gm_isz_class_Pistol ) ) + if ( GetActiveWeapon() && EntIsClass( GetActiveWeapon(), gm_isz_class_Pistol ) ) #else if( Weapon_OwnsThisType( "weapon_pistol" ) ) #endif diff --git a/sp/src/game/server/hl2/weapon_sniperrifle.cpp b/sp/src/game/server/hl2/weapon_sniperrifle.cpp index 10777f89..f2939fcc 100644 --- a/sp/src/game/server/hl2/weapon_sniperrifle.cpp +++ b/sp/src/game/server/hl2/weapon_sniperrifle.cpp @@ -107,7 +107,7 @@ END_DATADESC() //----------------------------------------------------------------------------- acttable_t CWeaponSniperRifle::m_acttable[] = { - { ACT_RANGE_ATTACK1, ACT_RANGE_ATTACK_SNIPER_RIFLE, true } + { ACT_RANGE_ATTACK1, ACT_RANGE_ATTACK_SNIPER_RIFLE, true }, #if EXPANDED_HL2_UNUSED_WEAPON_ACTIVITIES // Optional new NPC activities diff --git a/sp/src/game/server/player.cpp b/sp/src/game/server/player.cpp index 00aefbb8..6092dcd8 100644 --- a/sp/src/game/server/player.cpp +++ b/sp/src/game/server/player.cpp @@ -662,6 +662,7 @@ void CBasePlayer::CreateHandModel(int index, int iOtherVm) DispatchSpawn(vm); vm->FollowEntity(GetViewModel(iOtherVm), true); m_hViewModel.Set(index, vm); + vm->AddEffects( EF_NODRAW ); } } #endif diff --git a/sp/src/game/shared/baseviewmodel_shared.cpp b/sp/src/game/shared/baseviewmodel_shared.cpp index aa8ddbae..5f9c0f10 100644 --- a/sp/src/game/shared/baseviewmodel_shared.cpp +++ b/sp/src/game/shared/baseviewmodel_shared.cpp @@ -368,7 +368,7 @@ void CBaseViewModel::SetWeaponModel( const char *modelname, CBaseCombatWeapon *w #ifdef MAPBASE // If our owning weapon doesn't support hands, disable the hands viewmodel(s) - bool bSupportsHands = weapon->UsesHands(); + bool bSupportsHands = weapon != NULL ? weapon->UsesHands() : false; for (CBaseEntity *pChild = FirstMoveChild(); pChild != NULL; pChild = pChild->NextMovePeer()) { if (pChild->GetClassname()[0] == 'h') diff --git a/sp/src/game/shared/takedamageinfo.h b/sp/src/game/shared/takedamageinfo.h index 840432b1..046c8111 100644 --- a/sp/src/game/shared/takedamageinfo.h +++ b/sp/src/game/shared/takedamageinfo.h @@ -344,12 +344,12 @@ inline void CTakeDamageInfo::SetDamageCustom( int iDamageCustom ) inline int CTakeDamageInfo::GetDamageStats() const { - return m_iDamageCustom; + return m_iDamageStats; } inline void CTakeDamageInfo::SetDamageStats( int iDamageCustom ) { - m_iDamageCustom = iDamageCustom; + m_iDamageStats = iDamageCustom; } inline int CTakeDamageInfo::GetAmmoType() const