Fixed, Edit Things window: thing type validation when editing multiple thing types was broken in r2527.

This commit is contained in:
MaxED 2016-02-29 08:10:11 +00:00 committed by spherallic
parent 73f650bf64
commit 503ce1bfaf
2 changed files with 12 additions and 9 deletions

View file

@ -391,7 +391,7 @@ namespace CodeImp.DoomBuilder.Windows
}
// Verify the type
if(((thingtype.GetFullType(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetFullType(0) > General.Map.FormatInterface.MaxThingType)))
if(!string.IsNullOrEmpty(thingtype.TypeStringValue) && ((thingtype.GetFullType(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetFullType(0) > General.Map.FormatInterface.MaxThingType)))
{
General.ShowWarningMessage("Thing type must be between " + General.Map.FormatInterface.MinThingType + " and " + General.Map.FormatInterface.MaxThingType + ".", MessageBoxButtons.OK);
return;
@ -621,12 +621,14 @@ namespace CodeImp.DoomBuilder.Windows
action_ValueChanges(this, EventArgs.Empty);
//mxd. Update things
if(preventchanges) return;
MakeUndo(); //mxd
if(((thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType)))
if(preventchanges ||
(!string.IsNullOrEmpty(thingtype.TypeStringValue) &&
thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType
|| thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType))
return;
MakeUndo(); //mxd
foreach(Thing t in things)
{
//Set type

View file

@ -442,7 +442,7 @@ namespace CodeImp.DoomBuilder.Windows
}
// Verify the type
if(((thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType)))
if(!string.IsNullOrEmpty(thingtype.TypeStringValue) && ((thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType) || (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType)))
{
General.ShowWarningMessage("Thing type must be between " + General.Map.FormatInterface.MinThingType + " and " + General.Map.FormatInterface.MaxThingType + ".", MessageBoxButtons.OK);
return;
@ -684,9 +684,10 @@ namespace CodeImp.DoomBuilder.Windows
action_ValueChanges(this, EventArgs.Empty);
//mxd. Update things
if(preventchanges
|| (thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType)
|| (thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType))
if(preventchanges ||
(!string.IsNullOrEmpty(thingtype.TypeStringValue) &&
thingtype.GetResult(0) < General.Map.FormatInterface.MinThingType
|| thingtype.GetResult(0) > General.Map.FormatInterface.MaxThingType))
return;
MakeUndo(); //mxd