From 146f469524d16fa5d881122092efc9fe9d37d47e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 2 Sep 2008 00:03:16 +0000 Subject: Add an explicit cast to bool for the if expression so that any base types that slip in will not cause it to break --- OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index b357ab6..c8d1d16 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. -- cgit v1.1