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

Fix: Glock18 and Famas undesired ammo decreasing on burst mode #832

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

dystopm
Copy link
Contributor

@dystopm dystopm commented May 16, 2023

Consider the next scenario:

  1. Get a glock with clip-bpammo of 20-1
  2. Shoot 3 bullets on burst mode, leaving clip-bpammo of 17-1
  3. Try to reload, won't let

You need to call TabulateAmmo to enable reload again (shoot in single mode).

There is no reason to decrease bpammo on clip decreasing action anyways.
(and there is no reason to use ammo_ members from CBaseEntity)

@dystopm
Copy link
Contributor Author

dystopm commented Jul 6, 2023

@s1lentq @wopox1337 it's worth it?

@@ -761,16 +761,19 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI
if (bIsGlock)
{
vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, 0.05, 8192, 1, BULLET_PLAYER_9MM, 18, 0.9, m_pPlayer->pev, true, m_pPlayer->random_seed);
#ifndef REGAMEDLL_FIXES
--m_pPlayer->ammo_9mm;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't understand the original logic behind valve's original GameDLL. Why does it need to reduce ammo from the holster every time a shot is fired? It's weird.

@wopox1337 wopox1337 changed the title Fix Glock and Famas undesired ammo decreasing on burst mode Fix: Glock18 and Famas undesired ammo decreasing on burst mode Jul 10, 2023
@wopox1337 wopox1337 merged commit a5f288f into s1lentq:master Jul 10, 2023
@dystopm dystopm deleted the fireremaining-fix branch July 19, 2023 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants