Skip to content

[BUG] Sidebar wreck field icon checks the wrong planet's Space Dock level #1397

Description

@Geda173

Describe the bug
In resources/views/ingame/layouts/main.blade.php, the sidebar planet list iterates over all of a player's planets to decide whether to show a wreck field icon next to each one. The Space Dock level check at line 1788 reads:

$hasSpaceDock = $currentPlayer->planets->current()->getObjectLevel('space_dock') > 0;

This checks the currently selected planet's Space Dock level instead of the planet being iterated ($planet). It should be:

$hasSpaceDock = $planet->getObjectLevel('space_dock') > 0;

The wrong planet being evaluated causes two opposite failure modes for players with multiple planets:

  • False positive: Planet A is selected (Space Dock ≥ 1), Planet B has wreckage but no Space Dock. The icon appears next to Planet B even though the player cannot inspect or repair the wreckage from there.
  • False negative: Planet B is selected (no Space Dock), Planet A has wreckage and a Space Dock. The icon is hidden next to Planet A even though the player can inspect and repair the wreckage.

The icons should only appear when the planet has a wreck field AND has a Space Dock with level >0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions