Skip to content

Comments

Fix throwable weapons not working#217

Open
AndyBodnar wants to merge 1 commit intoqbcore-framework:mainfrom
AndyBodnar:fix/throwable-weapons-not-working
Open

Fix throwable weapons not working#217
AndyBodnar wants to merge 1 commit intoqbcore-framework:mainfrom
AndyBodnar:fix/throwable-weapons-not-working

Conversation

@AndyBodnar
Copy link

Summary

  • Removes the DrawWeapon event trigger for throwable weapons and snowball
  • The draw animation system was blocking firing controls, preventing throws

Root Cause

The qb-weapons:client:DrawWeapon event triggers an animation system in weapdraw.lua that:

  1. Sets canFire = false
  2. Calls CeaseFire() which runs a loop calling DisablePlayerFiring()
  3. This blocks the player's ability to throw until the animation completes

For throwables (single-use, instant-equip items), this draw animation is unnecessary and causes the "not thrown" bug.

Test plan

  • Give yourself weapon_bzgas and verify you can throw it immediately
  • Test other throwables: grenade, molotov, stickybomb, pipebomb, smokegrenade, flare, proxmine, ball
  • Test snowball works correctly
  • Verify regular weapons still have their draw animations

References

Fixes qbcore-framework/qb-inventory#638

@AndyBodnar AndyBodnar force-pushed the fix/throwable-weapons-not-working branch from 2ce5a15 to db12415 Compare January 23, 2026 17:55
@AndyBodnar
Copy link
Author

Testing

Tested with LuaGround (QBCore testing framework): https://github.com/AndyBodnar/LuaGround

Test file: qb_weapons_throwable_test.lua

Results: All 7 tests passed ✅

=== Throwable Weapons Fix (#638) ===
  ✓ should identify all throwable weapons correctly
  ✓ FIXED: throwables should NOT trigger DrawWeapon event
  ✓ FIXED: throwables should still call weapon natives correctly
  ✓ BROKEN (old behavior): throwables triggered DrawWeapon which blocked throwing
  ✓ regular weapons should still trigger DrawWeapon event
  ✓ snowball should also skip DrawWeapon and get 10 ammo
  ✓ should properly toggle off throwable when used again

Passed: 7
Failed: 0

@Storm-Trouper-NWO
Copy link

.

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.

[BUG] throwable weapons

2 participants