Small fixes for issues of various sizes

This commit is contained in:
Blixibon 2022-04-26 08:04:54 -05:00
parent b04fb3c43f
commit daa4779978
9 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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 );
}

View File

@ -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) );
}
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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