From 4b9bf6f7acd3a1bf8323f7c520184541c023cbbe Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Wed, 1 Jun 2016 23:20:41 +0200 Subject: [PATCH] Colormap is now applied correctly to flipped Things --- .../Plugins/BuilderModes/VisualModes/BaseVisualThing.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs index 7497d4b..7daeef6 100644 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualThing.cs @@ -210,7 +210,8 @@ namespace CodeImp.DoomBuilder.BuilderModes if(!info.Bright) { - Vector3D thingpos = new Vector3D(Thing.Position.x, Thing.Position.y, Thing.Position.z + sd.Floor.plane.GetZ(Thing.Position)); + float thingz = Thing.IsFlipped ? sd.Ceiling.plane.GetZ(Thing.Position) - Thing.Position.z - Thing.Height : Thing.Position.z + sd.Floor.plane.GetZ(Thing.Position); + Vector3D thingpos = new Vector3D(Thing.Position.x, Thing.Position.y, thingz); SectorLevel level = sd.GetLevelAboveOrAt(thingpos); //mxd. Let's use point on floor plane instead of Thing.Sector.FloorHeight; @@ -270,8 +271,9 @@ namespace CodeImp.DoomBuilder.BuilderModes //TECH: even Bright Thing frames are affected by custom fade... else { - Vector3D thingpos = new Vector3D(Thing.Position.x, Thing.Position.y, Thing.Position.z + sd.Floor.plane.GetZ(Thing.Position)); - SectorLevel level = sd.GetLevelAboveOrAt(thingpos); + float thingz = Thing.IsFlipped ? sd.Ceiling.plane.GetZ(Thing.Position) - Thing.Position.z - Thing.Height : Thing.Position.z + sd.Floor.plane.GetZ(Thing.Position); + Vector3D thingpos = new Vector3D(Thing.Position.x, Thing.Position.y, thingz); + SectorLevel level = sd.GetLevelAboveOrAt(thingpos); if (level != null && level.sector.FogMode > SectorFogMode.CLASSIC) {