From 4e80866ca6156a9fa65e8c8539c0756ee5ae7a50 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Mon, 25 Oct 2021 21:19:01 +0200 Subject: Coupler types: Better output when there are no couplers on a wagon --- advtrains/couple.lua | 2 ++ 1 file changed, 2 insertions(+) (limited to 'advtrains/couple.lua') diff --git a/advtrains/couple.lua b/advtrains/couple.lua index b812dec..c421f61 100644 --- a/advtrains/couple.lua +++ b/advtrains/couple.lua @@ -324,9 +324,11 @@ function advtrains.check_matching_coupler_types(t1, t1_front, t2, t2_front) for typ,_ in pairs(t1_cplt) do table.insert(t1_cplhr, advtrains.coupler_types[typ] or typ) end + if #t1_cplhr==0 then t1_cplhr[1]=attrans("") end for typ,_ in pairs(t2_cplt) do table.insert(t2_cplhr, advtrains.coupler_types[typ] or typ) end + if #t2_cplhr==0 then t2_cplhr[1]=attrans("") end return false, attrans("Can not couple: The couplers of the trains do not match (@1 and @2).", table.concat(t1_cplhr, ","), table.concat(t2_cplhr, ",")) end -- cgit v1.2.3