Bug 2737 - Inventory item toggle glitch
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P2 minor
Assignee: Tim Angus
QA Contact:
URL:
: 2835
Depends on:
Blocks:
 
Reported: 2006-06-09 14:23 EDT by Martin Doucha
Modified: 2006-09-01 14:49:08 EDT
2 users (show)

See Also:


Attachments
Bugfix - clear pm->ps->weaponstate, player cannot fire without ammo (365 bytes, patch)
2006-06-09 14:25 EDT, Martin Doucha

Description Martin Doucha 2006-06-09 14:23:33 EDT
When human runs out of ammo for primary weapon, he can't toggle inventory items (throw grenades, use medkit, change weapon, toggle jetpack) sometimes. These actions are conditioned on (game/bg_pmove.c line 2712):
pm->ps->weaponTime <= 0 || pm->ps->weaponstate != WEAPON_FIRING

pm->ps->weaponstate is never cleared since it is set to WEAPON_FIRING and pm->ps->weaponTime is repeatedly set to 200ms in out-of-ammo block of code in PM_Weapon() causing the glitch until weapon is changed.
Comment 1 Martin Doucha 2006-06-09 14:25:58 EDT
Created attachment 930 [details]
Bugfix - clear pm->ps->weaponstate, player cannot fire without ammo

Clearing pm->ps->weaponstate fixes the glitch.
Comment 2 Tim Angus 2006-06-10 13:10:18 EDT
Thanks.
Comment 3 Martin Doucha 2006-08-18 03:34:21 EDT
*** Bug 2835 has been marked as a duplicate of this bug. ***
Comment 4 Martin Doucha 2006-09-01 14:49:08 EDT
*** Bug 2835 has been marked as a duplicate of this bug. ***