diff --git a/Source/Core/Properties/AssemblyInfo.cs b/Source/Core/Properties/AssemblyInfo.cs index 71445444..0876e49b 100755 --- a/Source/Core/Properties/AssemblyInfo.cs +++ b/Source/Core/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ using CodeImp.DoomBuilder; // Build Number // Revision // -[assembly: AssemblyVersion("2.3.0.2833")] +[assembly: AssemblyVersion("2.3.0.2834")] [assembly: NeutralResourcesLanguageAttribute("en")] -[assembly: AssemblyHash("a1dc4bb")] +[assembly: AssemblyHash("87fdd67")] diff --git a/Source/Core/ZDoom/DecorateStateStructure.cs b/Source/Core/ZDoom/DecorateStateStructure.cs index ac6e8190..57dcd692 100755 --- a/Source/Core/ZDoom/DecorateStateStructure.cs +++ b/Source/Core/ZDoom/DecorateStateStructure.cs @@ -45,7 +45,7 @@ namespace CodeImp.DoomBuilder.ZDoom parser.DataStream.Seek(-(lasttoken.Length + 1), SeekOrigin.Current); // Done here - return; + goto endofallthings; } //mxd. Start of inner scope? else if (token == "{") @@ -69,7 +69,7 @@ namespace CodeImp.DoomBuilder.ZDoom parser.DataStream.Seek(-1, SeekOrigin.Current); // Done here - return; + goto endofallthings; } else { @@ -97,7 +97,7 @@ namespace CodeImp.DoomBuilder.ZDoom parser.DataStream.Seek(-(token.Length + 1), SeekOrigin.Current); // Done here - return; + goto endofallthings; } // No first sprite yet? @@ -158,7 +158,11 @@ namespace CodeImp.DoomBuilder.ZDoom return; } - if (!parser.NextTokenIs(")")) return; + if (!parser.NextTokenIs(")")) + { + parser.ReportError("Expected closing parenthesis in Light()"); + return; + } } //mxd. Inner scope start. Step back and reparse using parent loop else if (t == "{") @@ -191,7 +195,7 @@ namespace CodeImp.DoomBuilder.ZDoom parser.DataStream.Seek(-1, SeekOrigin.Current); // Done here - return; + goto endofallthings; } // Read next token @@ -202,6 +206,11 @@ namespace CodeImp.DoomBuilder.ZDoom lasttoken = token; } + + // return + endofallthings: + + TrimLeft(); } #endregion diff --git a/Source/Core/ZDoom/StateStructure.cs b/Source/Core/ZDoom/StateStructure.cs index 60d01152..dd4a3e79 100755 --- a/Source/Core/ZDoom/StateStructure.cs +++ b/Source/Core/ZDoom/StateStructure.cs @@ -70,6 +70,24 @@ namespace CodeImp.DoomBuilder.ZDoom #endregion #region ================== Methods + + // This removes useless images from the start of the state (TNT1) + protected void TrimLeft() // :) + { + // postprocess: if there are only TNT1 sprites, do nothing. however, if there were normal sprites as well, use these. + int firstNonEmpty = -1; + for (int i = 0; i < sprites.Count; i++) + { + if (!sprites[i].Sprite.StartsWith("TNT1")) + { + firstNonEmpty = i; + break; + } + } + + if (firstNonEmpty > 0) + sprites.RemoveRange(0, firstNonEmpty); + } // This finds the first valid sprite and returns it public FrameInfo GetSprite(int index) diff --git a/Source/Core/ZDoom/ZScriptActorStructure.cs b/Source/Core/ZDoom/ZScriptActorStructure.cs index 36919d4b..1ef7d22e 100755 --- a/Source/Core/ZDoom/ZScriptActorStructure.cs +++ b/Source/Core/ZDoom/ZScriptActorStructure.cs @@ -118,7 +118,15 @@ namespace CodeImp.DoomBuilder.ZDoom //parser.LogWarning(string.Format("{0} = [{1}]", propertyname, string.Join(", ", propertyvalues.ToArray()))); // set property - props[propertyname] = propertyvalues; + // translate "scale" to x and y scale + if (propertyname == "scale") + { + props["xscale"] = props["yscale"] = propertyvalues; + } + else + { + props[propertyname] = propertyvalues; + } break; } } diff --git a/Source/Core/ZDoom/ZScriptStateStructure.cs b/Source/Core/ZDoom/ZScriptStateStructure.cs index 35f85ceb..326ca5c0 100755 --- a/Source/Core/ZDoom/ZScriptStateStructure.cs +++ b/Source/Core/ZDoom/ZScriptStateStructure.cs @@ -82,7 +82,7 @@ namespace CodeImp.DoomBuilder.ZDoom if (token.Type == ZScriptTokenType.CloseCurly) { stream.Position--; - return; // done + break; // done } else if (token.Type == ZScriptTokenType.Identifier) { @@ -299,6 +299,8 @@ namespace CodeImp.DoomBuilder.ZDoom } // if identifier } // frame parsing loop (inner) } // state parsing loop (outer) + + TrimLeft(); } } } diff --git a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs index fc4d207a..cf9140bc 100755 --- a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs +++ b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Resources; // Build Number // Revision // -[assembly: AssemblyVersion("2.3.0.2833")] +[assembly: AssemblyVersion("2.3.0.2834")] [assembly: NeutralResourcesLanguageAttribute("en")]