Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions data/modules/DonateToCranks/DonateToCranks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ local computeReputation = function (ad)
return donate
end
end
-- aught not come here unless player has maxed out reputation
-- aught not come here unless player has maxed out donation
return 0
end

Expand All @@ -73,8 +73,13 @@ local onChat = function (form, ref, option)
end

if option == 0 then
form:SetMessage(string.interp(flavours[ad.n].message, ad.stringVariables) .. "\n\n" .. string.interp(
l.SALES_PITCH, {cash = Format.Money(computeReputation(ad), false)}))
local cash = computeReputation(ad)
if cash > 0 then
form:SetMessage(string.interp(flavours[ad.n].message, ad.stringVariables) .. "\n\n" .. string.interp(
l.SALES_PITCH, {cash = Format.Money(cash, false)}))
else
form:SetMessage(string.interp(flavours[ad.n].message, ad.stringVariables))
end

elseif PlayerState.GetMoney() < option then
form:SetMessage(l.YOU_DO_NOT_HAVE_ENOUGH_MONEY)
Expand Down