mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Fixed, Randomize things mode: fixed a crash when trying to move things, which were initially outside of sector boundary when using Hexen or UDMF map format.
This commit is contained in:
parent
202014f62f
commit
9af958312b
1 changed files with 7 additions and 5 deletions
|
@ -128,11 +128,12 @@ namespace CodeImp.DoomBuilder.BuilderEffects
|
|||
if(General.Map.FormatInterface.HasThingHeight)
|
||||
{
|
||||
if(t.Sector == null) t.DetermineSector();
|
||||
if(t.Sector == null) continue;
|
||||
|
||||
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;
|
||||
if(t.Sector != null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
thingData.Add(d);
|
||||
|
@ -257,6 +258,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects
|
|||
{
|
||||
for(int i = 0; i < selection.Count; i++)
|
||||
{
|
||||
if(thingData[i].SectorHeight == 0) continue;
|
||||
int curAmmount = Math.Min(thingData[i].SectorHeight, Math.Max(0, thingData[i].ZOffset + ammount));
|
||||
selection[i].Move(selection[i].Position.x, selection[i].Position.y, curAmmount * thingData[i].JitterHeight);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue