Reset Thing flags when switching from a type with renamed flags to an unknown type

This commit is contained in:
MascaraSnake 2016-01-14 20:27:23 +01:00
parent f3a756c7d4
commit 4e988bb61f

View file

@ -191,7 +191,8 @@ namespace CodeImp.DoomBuilder.Windows
// Flags
ThingTypeInfo ti = General.Map.Data.GetThingInfoEx(ft.Type);
if (ti != null) flags.UpdateCheckboxes(ti.Flags);
IDictionary<string, string> newFlags = (ti == null || ti.Flags.Count == 0) ? General.Map.Config.ThingFlags : ti.Flags;
flags.UpdateCheckboxes(newFlags);
foreach (CheckBox c in flags.Checkboxes)
if(ft.Flags.ContainsKey(c.Tag.ToString())) c.Checked = ft.Flags[c.Tag.ToString()];
@ -621,7 +622,8 @@ namespace CodeImp.DoomBuilder.Windows
t.UpdateConfiguration();
}
if (thinginfo != null) flags.UpdateCheckboxes(thinginfo.Flags);
IDictionary<string, string> newFlags = (thinginfo == null || thinginfo.Flags.Count == 0) ? General.Map.Config.ThingFlags : thinginfo.Flags;
flags.UpdateCheckboxes(newFlags);
General.Map.IsChanged = true;
if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty);