mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-07 08:21:59 +00:00
Fixed, Visual mode: when thing's position is not absolute, it should always be positioned between floor and ceiling planes.
This commit is contained in:
parent
2a1cd2c7ae
commit
9dc3a7bac3
1 changed files with 8 additions and 24 deletions
|
@ -232,20 +232,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
SectorData sd = mode.GetSectorData(Thing.Sector);
|
SectorData sd = mode.GetSectorData(Thing.Sector);
|
||||||
pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
|
pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
|
||||||
/*if(Thing.Position.z > 0)
|
|
||||||
pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
|
|
||||||
else
|
|
||||||
pos.z = Thing.Sector.CeilHeight - info.Height;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
pos.z -= Thing.Position.z;
|
if(Thing.Position.z > 0) pos.z -= Thing.Position.z;
|
||||||
|
|
||||||
// Check if below floor
|
// Check if below floor
|
||||||
if((Thing.Sector != null) && (pos.z < Thing.Sector.FloorHeight))
|
float minz = sd.Floor.plane.GetZ(Thing.Position);
|
||||||
{
|
if(pos.z < minz) pos.z = minz;
|
||||||
// Put thing on the floor
|
|
||||||
SectorData sd = mode.GetSectorData(Thing.Sector);
|
|
||||||
pos.z = sd.Floor.plane.GetZ(Thing.Position);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -255,20 +247,12 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
{
|
{
|
||||||
SectorData sd = mode.GetSectorData(Thing.Sector);
|
SectorData sd = mode.GetSectorData(Thing.Sector);
|
||||||
pos.z = sd.Floor.plane.GetZ(Thing.Position);
|
pos.z = sd.Floor.plane.GetZ(Thing.Position);
|
||||||
/*if(Thing.Position.z == 0)
|
|
||||||
pos.z = sd.Floor.plane.GetZ(Thing.Position);
|
|
||||||
else
|
|
||||||
pos.z = Thing.Sector.FloorHeight;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
pos.z += Thing.Position.z;
|
if(Thing.Position.z > 0) pos.z += Thing.Position.z;
|
||||||
|
|
||||||
// Check if above ceiling
|
// Check if above ceiling
|
||||||
if((Thing.Sector != null) && ((pos.z + info.Height) > Thing.Sector.CeilHeight))
|
float maxz = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
|
||||||
{
|
if(pos.z > maxz) pos.z = maxz;
|
||||||
// Put thing against ceiling
|
|
||||||
SectorData sd = mode.GetSectorData(Thing.Sector);
|
|
||||||
pos.z = sd.Ceiling.plane.GetZ(Thing.Position) - info.Height;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue