[longomatch] Fix players filtering



commit bd82deecdbfe2f4c953eb4ff37d72e10900ecbfc
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu May 30 22:58:47 2013 +0200

    Fix players filtering

 LongoMatch.Core/Common/PlaysFilter.cs |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/LongoMatch.Core/Common/PlaysFilter.cs b/LongoMatch.Core/Common/PlaysFilter.cs
index 535c73e..ccc9388 100644
--- a/LongoMatch.Core/Common/PlaysFilter.cs
+++ b/LongoMatch.Core/Common/PlaysFilter.cs
@@ -142,21 +142,18 @@ namespace LongoMatch.Common
                }
                
                void UpdateFilters () {
+                       UpdateVisiblePlayers ();
                        UpdateVisibleCategories ();
                        UpdateVisiblePlays ();
-                       UpdateVisiblePlayers ();
                }
                
                void UpdateVisiblePlayers () {
                        visiblePlayers = new List<Player>();
-                       if (PlayersFilterEnabled) {
-                               return;
-                       }
-                       
                        foreach (Player p in project.LocalTeamTemplate.Concat (project.VisitorTeamTemplate)) {
-                               if (playersFilter.Contains (p)) {
-                                       visiblePlayers.Add (p);
+                               if (PlayersFilterEnabled && ! playersFilter.Contains (p)) {
+                                       continue;
                                }
+                               visiblePlayers.Add (p);
                        }
                }
                


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]