mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-19 06:51:09 +00:00
Effect browser form: fixed a bug where effects consisting of multiple bits were not selected correctly. Fixes #589
This commit is contained in:
parent
9944748cbf
commit
80a3237cc7
1 changed files with 5 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using CodeImp.DoomBuilder.Config;
|
||||
|
||||
|
@ -77,8 +78,10 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
if(effects.SelectedItems.Count == 0)
|
||||
{
|
||||
// Go for all bits
|
||||
foreach(GeneralizedBit ab in o.Bits)
|
||||
// Go for all bits. Start with the highest bits, then go backwards. We
|
||||
// have to do this since effects can consist of multiple bits, and starting
|
||||
// from the lowest might catch the wrong effects.
|
||||
foreach(GeneralizedBit ab in o.Bits.OrderByDescending(b => b.Index))
|
||||
{
|
||||
// Select this setting if matches
|
||||
if((effect & ab.Index) == ab.Index)
|
||||
|
|
Loading…
Reference in a new issue