Fixed, Visual mode: a case when thing's height was bigger than distance between floor and ceiling's planes is now handled the same way as in ZDoom.

This commit is contained in:
MaxED 2015-01-30 08:10:49 +00:00
parent 9dc3a7bac3
commit e687642cca

View file

@ -231,13 +231,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(Thing.Sector != null)
{
SectorData sd = mode.GetSectorData(Thing.Sector);
pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
float maxz = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
pos.z = maxz;
if(Thing.Position.z > 0) pos.z -= Thing.Position.z;
// Check if below floor
float minz = sd.Floor.plane.GetZ(Thing.Position);
if(pos.z < minz) pos.z = minz;
if(pos.z < minz) pos.z = Math.Min(minz, maxz);
}
}
else
@ -246,13 +247,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(Thing.Sector != null)
{
SectorData sd = mode.GetSectorData(Thing.Sector);
pos.z = sd.Floor.plane.GetZ(Thing.Position);
float minz = sd.Floor.plane.GetZ(Thing.Position);
pos.z = minz;
if(Thing.Position.z > 0) pos.z += Thing.Position.z;
// Check if above ceiling
float maxz = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
if(pos.z > maxz) pos.z = maxz;
if(pos.z > maxz) pos.z = Math.Max(minz, maxz);
}
}