Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

fix(inventory): prevent ammo from creating invalid metadata when removed from weapons#39

Merged
antond15 merged 1 commit into
CommunityOx:mainfrom
mikigoalie:ammo
Aug 17, 2025
Merged

fix(inventory): prevent ammo from creating invalid metadata when removed from weapons#39
antond15 merged 1 commit into
CommunityOx:mainfrom
mikigoalie:ammo

Conversation

@mikigoalie

Copy link
Copy Markdown

Previously, ammo metadata was always passed with type (falsey value if no special ammo present), however table.matches does shallow check, and even if type = nil exists, it will result in mismatch of metadata.

I think this fix is probably slightly better than updating metadata checks, as I think the behaviour is probably predictable as it currently is.

This change ensures that metadata is only passed when a valid specialAmmo value
exists, avoiding the creation of { type = nil } and allowing ammo to stack
correctly with existing items.

@mikigoalie mikigoalie mentioned this pull request Aug 17, 2025

@antond15 antond15 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@antond15 antond15 merged commit 7c0c32e into CommunityOx:main Aug 17, 2025
@mikigoalie mikigoalie deleted the ammo branch August 18, 2025 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants