From ff5cea7ba3ec72c10201d795ca78f9fff2c136bb Mon Sep 17 00:00:00 2001 From: biwa <6475593+biwa@users.noreply.github.com> Date: Tue, 7 Apr 2020 21:18:07 +0200 Subject: [PATCH] Fixed rare potential crash when raising/lowering floors/ceiling to the closed neighbor --- .../BuilderModes/VisualModes/BaseVisualMode.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs index 6d142ce6..52e2cf61 100755 --- a/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs +++ b/Source/Plugins/BuilderModes/VisualModes/BaseVisualMode.cs @@ -2457,12 +2457,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if (target.picked is VisualFloor) { VisualFloor vf = (VisualFloor)target.picked; - floors.Add(vf.Level.sector, vf); + floors[vf.Level.sector] = vf; } else if (target.picked is VisualCeiling) { VisualCeiling vc = (VisualCeiling)target.picked; - ceilings.Add(vc.Level.sector, vc); + ceilings[vc.Level.sector] = vc; } else if (target.picked is BaseVisualThing) { @@ -2476,12 +2476,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if (i is VisualFloor) { VisualFloor vf = (VisualFloor)i; - floors.Add(vf.Level.sector, vf); + floors[vf.Level.sector] = vf; } else if (i is VisualCeiling) { VisualCeiling vc = (VisualCeiling)i; - ceilings.Add(vc.Level.sector, vc); + ceilings[vc.Level.sector] = vc; } else if (i is BaseVisualThing) { @@ -2698,12 +2698,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if (target.picked is VisualFloor) { VisualFloor vf = (VisualFloor)target.picked; - floors.Add(vf.Level.sector, vf); + floors[vf.Level.sector] = vf; } else if (target.picked is VisualCeiling) { VisualCeiling vc = (VisualCeiling)target.picked; - ceilings.Add(vc.Level.sector, vc); + ceilings[vc.Level.sector] = vc; } else if (target.picked is BaseVisualThing) { @@ -2717,12 +2717,12 @@ namespace CodeImp.DoomBuilder.BuilderModes if (i is VisualFloor) { VisualFloor vf = (VisualFloor)i; - floors.Add(vf.Level.sector, vf); + floors[vf.Level.sector] = vf; } else if (i is VisualCeiling) { VisualCeiling vc = (VisualCeiling)i; - ceilings.Add(vc.Level.sector, vc); + ceilings[vc.Level.sector] = vc; } else if (i is BaseVisualThing) {