Skip to content

Fix for non-bullet guns returned as 0 in weapon data - #1046

Merged
AmyrAhmady merged 1 commit into
openmultiplayer:masterfrom
NexiusTailer:patch-1
Jan 20, 2025
Merged

AmyrAhmady merged 1 commit into
openmultiplayer:masterfrom
NexiusTailer:patch-1

Conversation

@NexiusTailer

@NexiusTailer NexiusTailer commented Jan 19, 2025 •

Copy link
Copy Markdown
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 I consider this whole check not so crucial, because an "issue" it's aimed to fix doesn't even seem as a real one, and the way of fixing is strange since it doesn't change anything until scrolling the weapons. 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
@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