Fix LaTeX output error for empty advtrains_livery_tools templates

This commit is contained in:
Y. Wang 2024-01-29 23:19:52 +01:00
parent 92e6fd5672
commit 0507e64a7b

View File

@ -291,12 +291,16 @@ This wagon can be customized with DlxTrains' livery system.
table.insert(st, string.format([[\subsection*{Template: %s}]], SL(tname)))
table.insert(st, SL(tdef.notes))
table.insert(st, "")
table.insert(st, "This template contains the following components:")
table.insert(st, [[\begin{itemize}]])
for _, overlay in ipairs(tdef.overlays) do
table.insert(st, string.format([[\item %s]], SL(overlay.name)))
if #tdef.overlays > 0 then
table.insert(st, "This template contains the following components:")
table.insert(st, [[\begin{itemize}]])
for _, overlay in ipairs(tdef.overlays) do
table.insert(st, string.format([[\item %s]], SL(overlay.name)))
end
table.insert(st, [[\end{itemize}]])
else
table.insert(st, "This template does not appear to contain any (customizable) component.")
end
table.insert(st, [[\end{itemize}]])
end
for _, lname in ipairs(atlivdef.livery_names) do
local ldef = atlivdef.liveries[lname]