mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-18 10:01:48 +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
fbca0922f4
commit
9e2e2221cb
1 changed files with 7 additions and 5 deletions
|
@ -128,11 +128,12 @@ namespace CodeImp.DoomBuilder.BuilderEffects
|
||||||
if(General.Map.FormatInterface.HasThingHeight)
|
if(General.Map.FormatInterface.HasThingHeight)
|
||||||
{
|
{
|
||||||
if(t.Sector == null) t.DetermineSector();
|
if(t.Sector == null) t.DetermineSector();
|
||||||
if(t.Sector == null) continue;
|
if(t.Sector != null)
|
||||||
|
{
|
||||||
d.SectorHeight = Math.Max(0, t.Sector.CeilHeight - (int)t.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;
|
if(MaxSafeHeightDistance < d.SectorHeight) MaxSafeHeightDistance = d.SectorHeight;
|
||||||
d.ZOffset = (int)t.Position.z;
|
d.ZOffset = (int)t.Position.z;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
thingData.Add(d);
|
thingData.Add(d);
|
||||||
|
@ -257,6 +258,7 @@ namespace CodeImp.DoomBuilder.BuilderEffects
|
||||||
{
|
{
|
||||||
for(int i = 0; i < selection.Count; i++)
|
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));
|
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);
|
selection[i].Move(selection[i].Position.x, selection[i].Position.y, curAmmount * thingData[i].JitterHeight);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue