mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Redid the backup activity system so that individual weapons can choose which activity tables to fall back to
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -230,6 +230,8 @@ public:
|
||||
static WeaponClass_t WeaponClassFromString(const char *str);
|
||||
|
||||
virtual bool SupportsBackupActivity(Activity activity);
|
||||
virtual acttable_t *GetBackupActivityList();
|
||||
virtual int GetBackupActivityListCount();
|
||||
#endif
|
||||
|
||||
virtual void Equip( CBaseCombatCharacter *pOwner );
|
||||
|
||||
@@ -83,6 +83,12 @@ public:
|
||||
|
||||
float GetDamageForActivity( Activity hitActivity );
|
||||
|
||||
#ifdef MAPBASE
|
||||
// Don't use backup activities
|
||||
acttable_t *GetBackupActivityList() { return NULL; }
|
||||
int GetBackupActivityListCount() { return 0; }
|
||||
#endif
|
||||
|
||||
CWeaponStunStick( const CWeaponStunStick & );
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user