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 for non-bullet guns returned as 0 in weapon data #1046

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

NexiusTailer
Copy link
Contributor

This pretty simply fixes an issue described in #1008 by removing the whole check which was the cause of a problem with GetPlayerWeaponData, when player got some non-bullet (e.g. melee, gift or special weapons) with 0 ammo and it still was in his hands, but after switching weapons back and forth, GetPlayerWeaponData has suddenly start returning 0 as weaponid in its slot which is wrong.

A bit more complicated solution with keeping the initial point of this check would be to add the extra condition like "do the clearing of both weapon and ammo in the slot only if this type of weapon (generally) has ammo but now a player has it 0". After some time of thinking I consider this whole check not so crucial (an "issue" it's aimed to fix doesn't even seem as a real one for me), so I decided to fix it with this way provided, just by removing it completely.

@AmyrAhmady AmyrAhmady merged commit c403591 into openmultiplayer:master Jan 20, 2025
14 checks passed
@NexiusTailer NexiusTailer deleted the patch-1 branch January 20, 2025 22:23
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