Skip to content

Commit

Permalink
WML: Don't add a \n before condition=lose objectives if there are no …
Browse files Browse the repository at this point in the history
…objectives listed before them.
  • Loading branch information
jostephd authored and Vultraz committed Jul 5, 2018
1 parent 02bdd17 commit 045d331
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions data/lua/wml/objectives.lua
Expand Up @@ -145,20 +145,25 @@ local function generate_objectives(cfg)
objectives = "<big>" .. insert_before_nl(summary, "</big>") .. "\n"
end
if win_objectives ~= "" then
if objectives ~= "" then objectives = objectives .. "\n" end
objectives = objectives .. "<big>" .. win_string .. "</big>\n" .. win_objectives
end
if lose_objectives ~= "" then
objectives = objectives .. "\n" .. "<big>" .. lose_string .. "</big>\n" .. lose_objectives
if objectives ~= "" then objectives = objectives .. "\n" end
objectives = objectives .. "<big>" .. lose_string .. "</big>\n" .. lose_objectives
end
if gold_carryover ~= "" then
objectives = objectives .. "\n" .. gold_carryover_string .. "\n" .. gold_carryover
if objectives ~= "" then objectives = objectives .. "\n" end
objectives = objectives .. gold_carryover_string .. "\n" .. gold_carryover
end
if notes ~= "" then
objectives = objectives .. "\n" .. notes_string .. "\n" .. notes
if objectives ~= "" then objectives = objectives .. "\n" end
objectives = objectives .. notes_string .. "\n" .. notes
end
local note = cfg.note
if note then
objectives = objectives .. "\n" .. note .. "\n"
if objectives ~= "" then objectives = objectives .. "\n" end
objectives = objectives .. note .. "\n"
end

return string.sub(tostring(objectives), 1, -2)
Expand Down

0 comments on commit 045d331

Please sign in to comment.