-
Notifications
You must be signed in to change notification settings - Fork 161
Description
Describe the bug
The GetAmmoOnWeapon input for logic_playerproxy mistakenly checks for secondary ammo values for grenades and the RPG, despite those weapons only having a primary ammo pool. It instead permanently adds a value of 3 or 1, for the RPG and grenades respectively, to the value it ends up passing.
Steps to reproduce
Steps to reproduce the behavior:
- Check the ammo of
weapon_rpgwithlogic_playerproxy'sGetAmmoOnWeapon input. - Pass this value to a logic_compare, or any other easy way of seeing a passed value.
- Note that, due to
GetAmmoOnWeaponchecking for primary and secondary ammo, combining those values, and passing it as a parameter, the passed value is always 3 + current RPG ammo. This is incorrect to expected behaviour (Though it's functionally as intended), which is to pass the current ammo.
RPG with no ammo passes a value of 3, for a nonexistent secondary ammo pool.
RPG with 3 ammo passes a value of 6, 3 primary ammo + 3 secondary ammo, for a weapon with no secondary ammo pool.
Grenades also have this issue, passing along a secondary ammo value of 1.
Expected behavior
the input is functioning perfectly fine and as intended, but it's simply not accounting for weapons with no secondary ammo mechanic. For the RPG/grenades, it should only pass the primary ammo.
Additional context
If fixing this is undesirable due to affecting existing maps/mods that may already account for this via map logic, I suggest the accompanying feature request: #500
VMF for testing this bug: weaponrpg_test.zip