Skip to content

Bug: Boat row missing its sprite icon in the attacks panel #4100

@camclark

Description

@camclark

Describe the bug
The boat rows in the attacks panel (bottom-right) are supposed to show a small colored boat sprite next to the troop count. The icon slot renders empty in the current build, both for outgoing and incoming transport boats.

Image

To Reproduce

  1. Start any game and build a port.
  2. Launch a transport boat to an enemy/wilderness target.
  3. Open the bottom-right attacks panel.
  4. The row shows troops + target name with no boat icon on the left.

Expected behavior
A colored boat sprite (tinted with the owner's territory color) appears on the left of the row, as it did before the canvas-removal migration.

Image

Additional context
src/client/hud/SpriteLoader.ts defines loadAllSprites() to populate the spriteMap that getSpriteForUnit() reads from, but nothing in the repo calls it:

$ git grep "loadAllSprites" -- 'src/**'
src/client/hud/SpriteLoader.ts:42:export const loadAllSprites = ...

The only previous caller lived in
src/client/graphics/layers/StructureIconsLayer.ts, which was deleted in 53cf2d4 ("migrate away from canvas"). Since then spriteMap stays empty → getSpriteForUnit() returns null → getColoredSprite() throws
AttacksDisplay.getBoatSpriteDataURL() swallows the error and returns "".

A one-line fix is to invoke loadAllSprites() from
AttacksDisplay.init(), but a more central preload site (wherever client assets are warmed up at startup) might be cleaner ... happy to defer.

Discord: cool_clarky

Metadata

Metadata

Assignees

No one assigned

    Labels

    Release BlockerThis feature/bug is a priority to work onapprovedApproved for a PR, if you assigned to the issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Triage

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions