mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 15:48:01 +03:00
Closes #176
This commit is contained in:
parent
875189fa24
commit
026a55eba0
@ -789,11 +789,18 @@ BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted)
|
||||
|
||||
bool CBasePlayerWeapon::HasSecondaryAttack()
|
||||
{
|
||||
if (m_pPlayer->HasShield())
|
||||
if (m_pPlayer && m_pPlayer->HasShield())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_API
|
||||
if (CSPlayerItem()->m_bHasSecondaryAttack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (m_iId)
|
||||
{
|
||||
case WEAPON_AK47:
|
||||
@ -1084,6 +1091,8 @@ void CBasePlayerWeapon::Spawn()
|
||||
if (GetItemInfo(&info)) {
|
||||
CSPlayerItem()->SetItemInfo(&info);
|
||||
}
|
||||
|
||||
CSPlayerItem()->m_bHasSecondaryAttack = HasSecondaryAttack();
|
||||
}
|
||||
|
||||
// CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal
|
||||
|
@ -32,7 +32,8 @@ class CBasePlayerItem;
|
||||
class CCSPlayerItem: public CCSAnimating
|
||||
{
|
||||
public:
|
||||
CCSPlayerItem()
|
||||
CCSPlayerItem() :
|
||||
m_bHasSecondaryAttack(false)
|
||||
{
|
||||
Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo));
|
||||
}
|
||||
@ -43,6 +44,7 @@ public:
|
||||
|
||||
public:
|
||||
ItemInfo m_ItemInfo;
|
||||
bool m_bHasSecondaryAttack;
|
||||
};
|
||||
|
||||
// Inlines
|
||||
|
Loading…
x
Reference in New Issue
Block a user