Skip to content

Commit

Permalink
Fix 'nil' in hyperdrive Maintenance BBS advert
Browse files Browse the repository at this point in the history
Supposed to print time since last maintenance of engines.
  • Loading branch information
impaktor authored and Webster Sheets committed Feb 10, 2024
1 parent 665a1c5 commit 2619555
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions data/modules/BreakdownServicing/BreakdownServicing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ local onChat = function (form, ref, option)
local pricesuggestion = string.interp(ad.price, {
drive = hyperdrive and hyperdrive:GetName() or lui.NONE,
price = Format.Money(price),
lasttime = lastServiceMessage(hyperdrive),
})

if not hyperdrive then
Expand All @@ -134,9 +135,7 @@ local onChat = function (form, ref, option)
form:SetFace(ad.mechanic)
-- Replace token with details of last service (which might have
-- been seconds ago)
form:SetMessage(string.interp(message, {
lasttime = lastServiceMessage(hyperdrive),
}))
form:SetMessage(message)
if not hyperdrive then
-- er, do nothing, I suppose.
elseif Game.player:GetMoney() < price then
Expand Down

0 comments on commit 2619555

Please sign in to comment.