mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 23:58:06 +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()
|
bool CBasePlayerWeapon::HasSecondaryAttack()
|
||||||
{
|
{
|
||||||
if (m_pPlayer->HasShield())
|
if (m_pPlayer && m_pPlayer->HasShield())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_API
|
||||||
|
if (CSPlayerItem()->m_bHasSecondaryAttack)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (m_iId)
|
switch (m_iId)
|
||||||
{
|
{
|
||||||
case WEAPON_AK47:
|
case WEAPON_AK47:
|
||||||
@ -1084,6 +1091,8 @@ void CBasePlayerWeapon::Spawn()
|
|||||||
if (GetItemInfo(&info)) {
|
if (GetItemInfo(&info)) {
|
||||||
CSPlayerItem()->SetItemInfo(&info);
|
CSPlayerItem()->SetItemInfo(&info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSPlayerItem()->m_bHasSecondaryAttack = HasSecondaryAttack();
|
||||||
}
|
}
|
||||||
|
|
||||||
// CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal
|
// CALLED THROUGH the newly-touched weapon's instance. The existing player weapon is pOriginal
|
||||||
|
@ -32,7 +32,8 @@ class CBasePlayerItem;
|
|||||||
class CCSPlayerItem: public CCSAnimating
|
class CCSPlayerItem: public CCSAnimating
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CCSPlayerItem()
|
CCSPlayerItem() :
|
||||||
|
m_bHasSecondaryAttack(false)
|
||||||
{
|
{
|
||||||
Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo));
|
Q_memset(&m_ItemInfo, 0, sizeof(m_ItemInfo));
|
||||||
}
|
}
|
||||||
@ -43,6 +44,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ItemInfo m_ItemInfo;
|
ItemInfo m_ItemInfo;
|
||||||
|
bool m_bHasSecondaryAttack;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Inlines
|
// Inlines
|
||||||
|
Loading…
x
Reference in New Issue
Block a user