Fixed a bug where trying to align the grid to a linedef or setting the grid origin to a vertex would crash when no map was opened. Fixes #536

This commit is contained in:
biwa 2021-03-14 16:40:55 +01:00
parent feef304423
commit 2abcbfffab

View file

@ -2948,6 +2948,9 @@ namespace CodeImp.DoomBuilder.Windows
[BeginAction("aligngridtolinedef")]
protected void AlignGridToLinedef()
{
if (General.Map == null)
return;
if (General.Map.Map.SelectedLinedefsCount != 1)
{
General.Interface.DisplayStatus(StatusType.Warning, "Exactly one linedef must be selected");
@ -2965,6 +2968,9 @@ namespace CodeImp.DoomBuilder.Windows
[BeginAction("setgridorigintovertex")]
protected void SetGridOriginToVertex()
{
if (General.Map == null)
return;
if (General.Map.Map.SelectedVerticessCount != 1)
{
General.Interface.DisplayStatus(StatusType.Warning, "Exactly one vertex must be selected");