diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index 6e5623154a..25c823d0b9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs @@ -194,5 +194,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { SetVars(m_InitialValues); } + + public void NoOp() + { + // Does what is says on the packet. Nowt, nada, nothing. + // Required for insertion after a jump label to do what it says on the packet! + // With a bit of luck the compiler may even optimize it out. + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs index 795d38f497..37d29f7400 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs @@ -474,7 +474,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools /// String containing C# code for JumpLabel jl. private string GenerateJumpLabel(JumpLabel jl) { - return Generate(String.Format("{0}:\n", jl.LabelName), jl); + return Generate(String.Format("{0}:", CheckName(jl.LabelName)), jl) + " NoOp();\n"; } /// @@ -484,7 +484,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools /// String containing C# code for JumpStatement js. private string GenerateJumpStatement(JumpStatement js) { - return Generate(String.Format("goto {0}", js.TargetName), js); + return Generate(String.Format("goto {0}", CheckName(js.TargetName)), js); } ///