Redid the backup activity system so that individual weapons can choose which activity tables to fall back to

This commit is contained in:
Blixibon
2021-10-10 19:56:40 -05:00
parent 3431f21f4d
commit b9f3ac03fa
9 changed files with 77 additions and 20 deletions

View File

@@ -1077,6 +1077,11 @@ WeaponClass_t CBaseCombatWeapon::WeaponClassFromString(const char *str)
return WEPCLASS_INVALID;
}
#ifdef HL2_DLL
extern acttable_t *GetSMG1Acttable();
extern int GetSMG1ActtableCount();
#endif
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@@ -1084,12 +1089,32 @@ bool CBaseCombatWeapon::SupportsBackupActivity(Activity activity)
{
// Derived classes should override this.
// Pistol and melee users should not use SMG animations for missing pistol activities.
if (WeaponClassify() == WEPCLASS_HANDGUN || IsMeleeWeapon())
#ifdef HL2_DLL
// Melee users should not use SMG animations for missing activities.
if (IsMeleeWeapon() && GetBackupActivityList() == GetSMG1Acttable())
return false;
#endif
return true;
}
acttable_t *CBaseCombatWeapon::GetBackupActivityList()
{
#ifdef HL2_DLL
return GetSMG1Acttable();
#else
return NULL;
#endif
}
int CBaseCombatWeapon::GetBackupActivityListCount()
{
#ifdef HL2_DLL
return GetSMG1ActtableCount();
#else
return 0;
#endif
}
#endif