Skip to content

fix: weapon type detection from cateogories not using the correct names#509

Open
Darxo wants to merge 1 commit into
MSUTeam:developmentfrom
Darxo:refactor-improve-weapontype-detection
Open

fix: weapon type detection from cateogories not using the correct names#509
Darxo wants to merge 1 commit into
MSUTeam:developmentfrom
Darxo:refactor-improve-weapontype-detection

Conversation

@Darxo

@Darxo Darxo commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Vanilla uses the weapon names from ::Const.Items.WeaponTypeName in this.m.Categories
The only reason that this code worked is, because the keys from ::Const.Items.WeaponType happen to be an exact subset of their respective full names

The current implementation (before this proposed fix) could cause complications, if a mod chooses to

  • rename some/all of the weapon types in WeaponTypeName (e.g. translation)
  • create new items, filling out their this.m.Cateogires with those new weapon type terms

Then MSU would not be able to detect the weapon types anymore, because it looks for the old, english keys from WeaponType, when it should scan for their human-readable names from WeaponTypeName

Vanilla uses the weapon names from ::Const.Items.WeaponTypeName in this.m.Categories
The only reason that this code worked is, because the keys from ::Const.Items.WeaponType happen to be an exact subset of their respective full names
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.

1 participant