mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2024-11-10 06:41:49 +00:00
Snap selection to grid: fixed a problem that could cause a crash if geometry got removed by snapping it to the grid
This commit is contained in:
parent
bf7cc42166
commit
7d180e5cae
5 changed files with 42 additions and 1 deletions
|
@ -256,6 +256,10 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
//mxd. map testing events
|
||||
public virtual bool OnMapTestBegin(bool testFromCurrentPosition) { return true; } //called before test map is launched. Returns false if map launch is impossible
|
||||
public virtual void OnMapTestEnd(bool testFromCurrentPosition) { } //called after game engine is closed
|
||||
|
||||
// This should be called by global actions (i.e. that are not part of an editing mode) when they changed map elements,
|
||||
// so that the mode can react to it (for example by rebuilding a blockmap)
|
||||
public virtual void OnMapElementsChanged() { }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -2592,6 +2592,9 @@ namespace CodeImp.DoomBuilder
|
|||
undoredo.WithdrawUndo();
|
||||
}
|
||||
|
||||
// Let the current editing mode know that we changed something
|
||||
General.Editing.Mode.OnMapElementsChanged();
|
||||
|
||||
// Done
|
||||
General.Interface.RedrawDisplay();
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
@ -2651,6 +2654,9 @@ namespace CodeImp.DoomBuilder
|
|||
// Map is changed
|
||||
General.Map.IsChanged = true;
|
||||
|
||||
// Let the current editing mode know that we changed something
|
||||
General.Editing.Mode.OnMapElementsChanged();
|
||||
|
||||
// Done
|
||||
General.Interface.RedrawDisplay();
|
||||
Cursor.Current = Cursors.Default;
|
||||
|
|
|
@ -1287,6 +1287,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return base.OnCopyBegin();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
//mxd
|
||||
private void RenderComment(Linedef l)
|
||||
{
|
||||
|
|
|
@ -1545,6 +1545,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
base.OnRedoEnd(); //mxd
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
//mxd
|
||||
public override void OnViewSelectionNumbersChanged(bool enabled)
|
||||
{
|
||||
|
|
|
@ -752,7 +752,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
|
||||
return base.OnCopyBegin();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If map elements have changed the blockmap needs to be recreated.
|
||||
/// </summary>
|
||||
public override void OnMapElementsChanged()
|
||||
{
|
||||
base.OnMapElementsChanged();
|
||||
|
||||
CreateBlockmap();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Actions
|
||||
|
|
Loading…
Reference in a new issue