Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grenadefixes #479

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions regamedll/dlls/wpn_shared/wpn_c4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ void CC4::PrimaryAttack()
if (--m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
{
RetireWeapon();
#ifdef REGAMEDLL_FIXES
DestroyItem();
#endif
return;
}
}
Expand Down
24 changes: 24 additions & 0 deletions regamedll/dlls/wpn_shared/wpn_flashbang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,26 @@ void CFlashbang::WeaponIdle()
{
// we've finished the throw, restart.
m_flStartThrow = 0;

#ifndef REGAMEDLL_FIXES
RetireWeapon();
#else
// from CHEGrenade::WeaponIdle(), CSmokeGrenade::WeaponIdle()
if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
SendWeaponAnim(FLASHBANG_DRAW, UseDecrement() != FALSE);
}
else
{
RetireWeapon();
DestroyItem();
return;
}

m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + RANDOM_FLOAT(10, 15);
m_flReleaseThrow = -1.0f;
#endif

}
else if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
Expand Down Expand Up @@ -263,5 +282,10 @@ void CFlashbang::WeaponIdle()

BOOL CFlashbang::CanDeploy()
{
#ifndef REGAMEDLL_FIXES
return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0;
#else
return TRUE;
#endif

}
8 changes: 8 additions & 0 deletions regamedll/dlls/wpn_shared/wpn_hegrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ void CHEGrenade::WeaponIdle()
else
{
RetireWeapon();
#ifdef REGAMEDLL_FIXES
DestroyItem();
#endif
return;
}

Expand Down Expand Up @@ -258,5 +261,10 @@ void CHEGrenade::WeaponIdle()

BOOL CHEGrenade::CanDeploy()
{
#ifndef REGAMEDLL_FIXES
return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0;
#else
return TRUE;
#endif

}
8 changes: 8 additions & 0 deletions regamedll/dlls/wpn_shared/wpn_smokegrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ void CSmokeGrenade::WeaponIdle()
else
{
RetireWeapon();
#ifdef REGAMEDLL_FIXES
DestroyItem();
#endif
return;
}

Expand Down Expand Up @@ -272,5 +275,10 @@ void CSmokeGrenade::WeaponIdle()

BOOL CSmokeGrenade::CanDeploy()
{
#ifndef REGAMEDLL_FIXES
return m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] != 0;
#else
return TRUE;
#endif

}