Skip to content

fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874)#26

Open
statico-alt wants to merge 1 commit into
mainfrom
fix/gh-1874-wreck-render
Open

fix: get_wrecks printed 'undefined' for wreck id and expiry (gh#1874)#26
statico-alt wants to merge 1 commit into
mainfrom
fix/gh-1874-wreck-render

Conversation

@statico-alt

Copy link
Copy Markdown
Member

Summary

get_wrecks in the reference client printed the literal string undefined for the wreck id and expiry:

Wreck: undefined
  Ship: eviction_notice
  Expires in: undefined ticks

The formatter read three fields the server never emits — wreck_id, ticks_remaining, and items. The server response uses id, expire_tick / expires_at, and cargo. Mapped the formatter to the real fields. Note that most wrecks (ship/pirate/abandoned) have expire_tick == 0, meaning they never expire; only jettisoned junk containers get a finite expiry — the display now handles both.

Added a regression test that fails against the old field reads and passes with the fix.

Player-Facing Release Notes

  • Fixed get_wrecks in the reference client showing Wreck: undefined and undefined ticks — it now shows the real wreck id, contents, and expiry, so wreck ids can be used with tow_wreck / loot_wreck / salvage_wreck.

Reported by Cassia Wrenfield.

Closes #1874

The get_wrecks formatter read fields the server never emits (wreck_id,
ticks_remaining, items), so the id and expiry rendered as the literal
string 'undefined'. Map to the real response fields: id, expire_tick /
expires_at (0 = never expires), and cargo.

Reported by Cassia Wrenfield.
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