Skip to content

[Bug]: Unitview.lua hardcodes missile enhancement slots #6951

@lL1l1

Description

@lL1l1

Describe the Bug

fa/lua/ui/game/unitview.lua

Lines 230 to 236 in f2448be

if curEnh.Back == 'TacticalMissile' or curEnh.Back == 'Missile' then
return string.format('%d / %d', info.tacticalSiloStorageCount, info.tacticalSiloMaxStorageCount)
, 'tactical'
elseif curEnh.Back == 'TacticalNukeMissile' then
return string.format('%d / %d', info.nukeSiloStorageCount, info.nukeSiloMaxStorageCount),
'strategic'
else

These enhancement slots and names are hardcoded, which will cause issues for modded units that probably don't know about this convention.

Reproduce the bug

Code a missile enhancement that uses a different slot or enhancement name.

Screenshots

No response

Additional context

Can be fixed by first searching through weapons for tactical/nuke weapons with silo ammo capacity and an EnabledByEnhancement field, then checking if the unit has the required enhancement for that weapon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions