Fixed a bug with pasted things when the Things Filter is used.

Fixed a bug with the Things Filter which caused some things to be incorrectly shown.
This commit is contained in:
codeimp 2011-12-02 21:03:05 +00:00
parent a5cb5fa000
commit 3448e1ff60
2 changed files with 19 additions and 4 deletions

View file

@ -290,7 +290,7 @@ namespace CodeImp.DoomBuilder.Editing
foreach(Thing t in General.Map.Map.Things)
{
bool qualifies = true;
// Get thing info
ThingTypeInfo ti = General.Map.Data.GetThingInfo(t.Type);
@ -321,7 +321,11 @@ namespace CodeImp.DoomBuilder.Editing
{
if(t.Flags.ContainsKey(s))
{
qualifies = (t.Flags[s] == true);
if(t.Flags[s] == false)
{
qualifies = false;
break;
}
}
else
{
@ -338,7 +342,13 @@ namespace CodeImp.DoomBuilder.Editing
foreach(string s in forbiddenfields)
{
if(t.Flags.ContainsKey(s))
qualifies = (t.Flags[s] == false);
{
if(t.Flags[s] == true)
{
qualifies = false;
break;
}
}
}
}
@ -350,7 +360,11 @@ namespace CodeImp.DoomBuilder.Editing
{
if(t.Fields.ContainsKey(kv.Key))
{
qualifies = (t.Fields[kv.Key].Type == kv.Value.Type) && (t.Fields[kv.Key].Value.Equals(kv.Value.Value));
if(!((t.Fields[kv.Key].Type == kv.Value.Type) && (t.Fields[kv.Key].Value.Equals(kv.Value.Value))))
{
qualifies = false;
break;
}
}
else
{

View file

@ -1272,6 +1272,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Update cached values
General.Map.Data.UpdateUsedTextures();
General.Map.Map.Update();
General.Map.ThingsFilter.Update();
// Make normal selection
General.Map.Map.ClearAllSelected();