ForbidWeaponUse mutator hook can leave the player holding a weapon they no longer possess
I noticed an issue in my mod Vore Tournament, which upon further investigation I suspect to be an undesired side effect with how the mutator hook works. Please correct me if this is a deliberate decision and not a bug.
The mutator hook ForbidWeaponUse makes it impossible to switch away from your weapon while it returns true. This causes the player to be stuck carrying a weapon they no longer have, in case another function removes the weapon from their inventory. Not even
W_SwitchWeapon_Force() will make the player switch away from the non-existent gun.
For instance: If the player was holding the Electro and you use
STAT(WEAPONS, this) &= ~WepSet_FromWeapon(wep) to remove it from them, the player will still appear to be holding the Electro even if it no longer shows up on the weapons bar, until ForbidWeaponUse returns false for one iteration.
To my knowledge, the goal of this hook is to prevent the player from firing or intentionally switching weapons. Causing them to carry a weapon they no longer have feels like a bug.