Fix sidebar wreck field icon using wrong planet Space Dock level#1495
Conversation
The planet list loop checked the currently selected planet's Space Dock level instead of the iterated planet's, hiding or showing the wreck field icon incorrectly for multi-planet accounts. Fixes lanedirt#1397 Co-authored-by: Cursor <cursoragent@cursor.com>
Geda173
left a comment
There was a problem hiding this comment.
Fix looks right. $planet is the @foreach variable from line 1730, and the two lines either side of this one (getPlanetCoordinates() on 1828, isMoon() on 1839) already use it, so this was the odd one out.
Could we get a feature test with it though? This bug is invisible to any single-planet test, because with one planet $planet and planets->current() are the same object. That's why the existing wreck field coverage didn't catch it: 32 tests across FacilitiesWreckFieldTest and WreckFieldTest all pass both with and without this fix. Nothing currently asserts on the sidebar either.
Assert the planet list icon uses each listed planet's Space Dock level, which single-planet wreck field tests cannot catch. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@Geda173 Good call — added
Confirmed both fail against the old |
Preview deployment
Preview environment has been cleaned up. |
|
Thank you, merging. |
Summary
In the sidebar planet list, the wreck field icon used the currently selected planet's Space Dock level instead of the iterated planet's.
Fixes #1397
Test plan
Related: tiweb442 #1491, #1492, #1494
Made with Cursor