Fix: IfThenElseSnippted would also trigger if any string was specified as condition; this should only be if 'true' or '"yes"'

This commit is contained in:
Pieter Vander Vennet 2022-10-27 13:35:01 +02:00
parent 86c62e520a
commit 717d0a9514

View file

@ -53,7 +53,7 @@ namespace AspectedRouting.IO.LuaSnippets
var isString = cond.Types.First().Equals(Typs.String);
result += Snippets.Convert(lua, c, cond) + "\n";
result += $"if ( {c} or {c} == \"yes\" ) then \n";
result += $"if ( {c} == true or {c} == \"yes\" ) then \n";
result += " " + Snippets.Convert(lua, assignTo, ifTrue).Indent();
if (ifElse != null)