Cursor position playtest: stop always marking map changed (#605)

This commit is contained in:
Derek MacDonald 2021-08-25 13:28:20 -04:00 committed by spherallic
parent e13c836344
commit 8a27615178

View file

@ -83,6 +83,7 @@ namespace CodeImp.DoomBuilder.Editing
private Thing playerStart;
private Vector3D playerStartPosition;
private bool playerStartIsTempThing;
private bool mapWasChangedBeforeTest;
#endregion
@ -723,6 +724,9 @@ namespace CodeImp.DoomBuilder.Editing
return false;
}
// Capture whether the map was changed before modifying player things.
mapWasChangedBeforeTest = General.Map.IsChanged;
//find Single Player Start. Should be type 1 in all games
Thing start = null;
@ -801,6 +805,13 @@ namespace CodeImp.DoomBuilder.Editing
}
playerStart = null;
// Restore the value of General.Map.IsChanged before player
// things were modified in OnMapTestBegin().
if (!mapWasChangedBeforeTest)
{
General.Map.ForceMapIsChangedFalse();
}
}
}