Skip to content
Snippets Groups Projects
Commit 05a64b4a authored by biwa's avatar biwa
Browse files

- Fixed a bug where searching for generalized sector effects was not handled...

- Fixed a bug where searching for generalized sector effects was not handled properly in Find & Replace Mode. Fixes 305.
parent 4b86f545
No related branches found
No related tags found
No related merge requests found
......@@ -115,7 +115,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
else if(General.Map.Config.GeneralizedEffects && effect != 0 && s.Effect != 0)
{
SectorEffectData sdo = General.Map.Config.GetSectorEffectData(s.Effect);
match = (sd.Effect == sdo.Effect || (sd.GeneralizedBits.Count == sdo.GeneralizedBits.Count && sd.GeneralizedBits.Overlaps(sdo.GeneralizedBits)));
// It's a bit complicated, so use the following logic:
// Searching for normal effect + generalized effect -> sector has to have both (plus optionally other generalized effects)
// Searching for generalized effect -> sector has to have this generalized effect (plus optionally other generalized effects) and optionally any normal effect
// Searching for normal effect -> sector has to have normal effect and optionally any generalized effect
if (sd.Effect != 0 && sd.GeneralizedBits.Count > 0)
match = sd.Effect == sdo.Effect && sd.GeneralizedBits.IsSubsetOf(sdo.GeneralizedBits);
else if (sd.GeneralizedBits.Count > 0)
match = sd.GeneralizedBits.IsSubsetOf(sdo.GeneralizedBits);
else if (sd.Effect == sdo.Effect)
match = true;
}
if(match)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment