From 146f469524d16fa5d881122092efc9fe9d37d47e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 2 Sep 2008 00:03:16 +0000 Subject: [PATCH] Add an explicit cast to bool for the if expression so that any base types that slip in will not cause it to break --- .../Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index b357ab6832..c8d1d16a66 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs @@ -470,9 +470,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { string retstr = String.Empty; - retstr += GenerateIndented("if (", ifs); + retstr += GenerateIndented("if ((bool)(", ifs); retstr += GenerateNode((SYMBOL) ifs.kids.Pop()); - retstr += GenerateLine(")"); + retstr += GenerateLine("))"); // CompoundStatement handles indentation itself but we need to do it // otherwise.