From 96fa507e9e634626a48f8f0ba5075de3b0f4468d Mon Sep 17 00:00:00 2001 From: MaxED Date: Wed, 9 Mar 2016 19:36:11 +0000 Subject: [PATCH] Fixed, Map Analysis mode: fixed a crash when running "Check Polyobjects" check on a map without lines using "Polyobj_StartLine" action. Updated ZDoom_linedefs.cfg (Line_SetPortalTarget). Updated ZDoom_ACS.cfg (Line_SetPortalTarget). --- .../Includes/ZDoom_linedefs.cfg | 16 ++++++++++++++ Build/Scripting/ZDoom_ACS.cfg | 1 + .../ErrorChecks/CheckPolyobjects.cs | 21 +++++++++++-------- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Build/Configurations/Includes/ZDoom_linedefs.cfg b/Build/Configurations/Includes/ZDoom_linedefs.cfg index 6f42cd40..cbddcde0 100644 --- a/Build/Configurations/Includes/ZDoom_linedefs.cfg +++ b/Build/Configurations/Includes/ZDoom_linedefs.cfg @@ -639,6 +639,22 @@ zdoom } } } + 107 + { + title = "Line Set Portal Target"; + id = "Line_SetPortalTarget"; + + arg0 + { + title = "Source Line Tag"; + type = 15; + } + arg1 + { + title = "Target Line Tag"; + type = 15; + } + } } door diff --git a/Build/Scripting/ZDoom_ACS.cfg b/Build/Scripting/ZDoom_ACS.cfg index abdfe227..34292e7e 100644 --- a/Build/Scripting/ZDoom_ACS.cfg +++ b/Build/Scripting/ZDoom_ACS.cfg @@ -256,6 +256,7 @@ keywords Line_AlignCeiling = "Line_AlignCeiling(lineid, side)"; Line_AlignFloor = "Line_AlignFloor(lineid, side)"; Line_SetBlocking = "Line_SetBlocking(lineid, setflags, clearflags)"; + Line_SetPortalTarget = "Line_SetPortalTarget(sourcelineid, targetlineid)"; Line_SetTextureOffset = "Line_SetTextureOffset(lineid, x, y, side, flags)"; Line_SetTextureScale = "Line_SetTextureScale(lineid, x, y, side, flags)"; LineSide = "int LineSide(void)"; diff --git a/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs b/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs index 3d1c2c75..b2d0a153 100644 --- a/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs +++ b/Source/Plugins/BuilderModes/ErrorChecks/CheckPolyobjects.cs @@ -113,17 +113,20 @@ namespace CodeImp.DoomBuilder.BuilderModes // Check Linedefs with Polyobj_StartLine action. These must connect 1 - 1. // Polyobject number is arg0, Mirror polyobject number is arg1 - foreach(KeyValuePair> linesbytype in polyobjlines[Polyobj_StartLine]) + if(polyobjlines.ContainsKey(Polyobj_StartLine)) { - // Should be only one Polyobj_StartLine per Polyobject number - if(linesbytype.Value.Count > 1) - SubmitResult(new ResultInvalidPolyobjectLines(linesbytype.Value, "Several \"" + Polyobj_StartLine + "\" actions have the same Polyobject Number assigned (" + linesbytype.Key + "). They won't function correctly ingame.")); - - // Check if Mirror Polyobject Number exists - foreach(Linedef linedef in linesbytype.Value) + foreach(KeyValuePair> linesbytype in polyobjlines[Polyobj_StartLine]) { - if(!startspots.ContainsKey(linedef.Args[1])) - SubmitResult(new ResultInvalidPolyobjectLines(new List { linedef }, "\"" + Polyobj_StartLine + "\" action have non-existing Mirror Polyobject Number assigned (" + linedef.Args[1] + "). It won't function correctly ingame.")); + // Should be only one Polyobj_StartLine per Polyobject number + if(linesbytype.Value.Count > 1) + SubmitResult(new ResultInvalidPolyobjectLines(linesbytype.Value, "Several \"" + Polyobj_StartLine + "\" actions have the same Polyobject Number assigned (" + linesbytype.Key + "). They won't function correctly ingame.")); + + // Check if Mirror Polyobject Number exists + foreach(Linedef linedef in linesbytype.Value) + { + if(!startspots.ContainsKey(linedef.Args[1])) + SubmitResult(new ResultInvalidPolyobjectLines(new List { linedef }, "\"" + Polyobj_StartLine + "\" action have non-existing Mirror Polyobject Number assigned (" + linedef.Args[1] + "). It won't function correctly ingame.")); + } } }