From 4034bd4c0c9f072ab49e6106bf71011ab40c8bb3 Mon Sep 17 00:00:00 2001
From: MaxED <j.maxed@gmail.com>
Date: Wed, 3 Jun 2015 13:20:06 +0000
Subject: [PATCH] Fixed, Visual mode: in some cases info lines for polyobject
 setup things were not shown. Fixed, Visual mode: z position of info lines for
 polyobject setup things was calculated incorrectly. Updated
 ZDoom_DECORATE.cfg.

---
 Build/Scripting/ZDoom_DECORATE.cfg                       | 3 ++-
 Source/Core/GZBuilder/Data/LinksCollector.cs             | 9 +++++----
 .../Plugins/BuilderEffects/Interface/JitterThingsForm.cs | 2 +-
 .../Plugins/BuilderModes/VisualModes/BaseVisualMode.cs   | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/Build/Scripting/ZDoom_DECORATE.cfg b/Build/Scripting/ZDoom_DECORATE.cfg
index bc3813f24..b38c176de 100644
--- a/Build/Scripting/ZDoom_DECORATE.cfg
+++ b/Build/Scripting/ZDoom_DECORATE.cfg
@@ -304,7 +304,7 @@ keywords
 	A_SkelWhoosh = "A_SkelWhoosh";
 	A_StartFire = "A_StartFire";
 	A_FireCrackle = "A_FireCrackle";
-	A_BFGSpray = "A_BFGSpray[(str flashtype = \"BFGExtra\"[, int numrays = 40[, int damage = 15[, float angle = 90.0[, float distance = 1024.0[, float vrange = 32.0[, int explicit_damage = 0]]]]]])]";
+	A_BFGSpray = "A_BFGSpray[(str flashtype = \"BFGExtra\"[, int numrays = 40[, int damagecnt = 15[, float angle = 90.0[, float distance = 1024.0[, float vrange = 32.0[, int explicit_damage = 0]]]]]])]";
 	A_BarrelDestroy = "A_BarrelDestroy";
 //Miscellaneous functions not listed in the "Action functions" wiki article
 	A_Bang4Cloud = "A_Bang4Cloud";
@@ -779,6 +779,7 @@ constants
 	NOTELEFRAG;
 	ALWAYSTELEFRAG;
 	DONTDRAIN;
+	LAXTELEFRAGDMG;
 //Appearance & Sound
 	BRIGHT;
 	INVISIBLE;
diff --git a/Source/Core/GZBuilder/Data/LinksCollector.cs b/Source/Core/GZBuilder/Data/LinksCollector.cs
index 3b6b816aa..7889233b2 100644
--- a/Source/Core/GZBuilder/Data/LinksCollector.cs
+++ b/Source/Core/GZBuilder/Data/LinksCollector.cs
@@ -3,7 +3,6 @@ using CodeImp.DoomBuilder.Map;
 using CodeImp.DoomBuilder.VisualModes;
 using CodeImp.DoomBuilder.GZBuilder.Geometry;
 using CodeImp.DoomBuilder.Geometry;
-using CodeImp.DoomBuilder.Config;
 
 namespace CodeImp.DoomBuilder.GZBuilder.Data 
 {
@@ -25,7 +24,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
 			foreach (VisualThing vt in visualThings) things.Add(vt.Thing);
 
 			ThingsCheckResult result = CheckThings(things);
-			if (result.ProcessPathNodes || result.ProcessInterpolationPoints || result.ProcessThingsWithGoal || result.ProcessCameras)
+			if (result.ProcessPathNodes || result.ProcessInterpolationPoints || result.ProcessThingsWithGoal || result.ProcessCameras || result.ProcessPolyobjects)
 				return GetThingLinks(result, true);
 			return new List<Line3D>();
 		}
@@ -280,9 +279,12 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
 					foreach(Thing anchor in group.Value)
 					{
 						start = anchor.Position;
+						if(correctHeight) start.z += GetCorrectHeight(anchor);
+
 						foreach(Thing startspot in polyobjectStartSpots[group.Key]) 
 						{
 							end = startspot.Position;
+							if(correctHeight) end.z += GetCorrectHeight(startspot);
 							lines.Add(new Line3D(start, end, Line3DType.ACTIVATOR));
 						}
 					}
@@ -294,8 +296,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
 
 		private static float GetCorrectHeight(Thing thing) 
 		{
-			ThingTypeInfo tti = General.Map.Data.GetThingInfo(thing.Type);
-			float height = tti.Height / 2f;
+			float height = thing.Height / 2f;
 			if (thing.Sector != null) height += thing.Sector.FloorHeight;
 			return height;
 		}
diff --git a/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs b/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs
index 7f9aeff5f..300d5429e 100644
--- a/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs
+++ b/Source/Plugins/BuilderEffects/Interface/JitterThingsForm.cs
@@ -130,7 +130,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects
 					if(t.Sector == null) t.DetermineSector();
 					if(t.Sector == null) continue;
 
-					d.SectorHeight = Math.Max(0, t.Sector.CeilHeight - (int)General.Map.Data.GetThingInfo(t.Type).Height - t.Sector.FloorHeight);
+					d.SectorHeight = Math.Max(0, t.Sector.CeilHeight - (int)t.Height - t.Sector.FloorHeight);
 					if(MaxSafeHeightDistance < d.SectorHeight) MaxSafeHeightDistance = d.SectorHeight;
 					d.ZOffset = (int)t.Position.z;
 				}
diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
index b355450e8..d3208cc96 100644
--- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
+++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs
@@ -2206,7 +2206,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
 				{
 					if(vt.Thing.Sector == null) continue;
 					SectorData sd = GetSectorData(vt.Thing.Sector);
-					vt.OnMove(new Vector3D(vt.Thing.Position, BuilderModesTools.GetHigherThingZ(sd, vt.Thing.Position, vt.Info.Height, vt.Info.AbsoluteZ, vt.Info.Hangs)));
+					vt.OnMove(new Vector3D(vt.Thing.Position, BuilderModesTools.GetHigherThingZ(sd, vt.Thing.Position, vt.Thing.Height, vt.Info.AbsoluteZ, vt.Info.Hangs)));
 				}
 			}
 
@@ -2418,7 +2418,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
 				{
 					if(vt.Thing.Sector == null) continue;
 					SectorData sd = GetSectorData(vt.Thing.Sector);
-					vt.OnMove(new Vector3D(vt.Thing.Position, BuilderModesTools.GetLowerThingZ(sd, vt.Thing.Position, vt.Info.Height, vt.Info.AbsoluteZ, vt.Info.Hangs)));
+					vt.OnMove(new Vector3D(vt.Thing.Position, BuilderModesTools.GetLowerThingZ(sd, vt.Thing.Position, vt.Thing.Height, vt.Info.AbsoluteZ, vt.Info.Hangs)));
 				}
 			}
 
-- 
GitLab