diff --git a/source/Trek-12/Models/Rules/Rules.cs b/source/Trek-12/Models/Rules/Rules.cs index e1ade34..91a595d 100644 --- a/source/Trek-12/Models/Rules/Rules.cs +++ b/source/Trek-12/Models/Rules/Rules.cs @@ -46,11 +46,13 @@ namespace Models.Rules public bool IsInRopePaths (Cell adjacente,List> ropePaths, int index) { - foreach (var path in ropePaths.Where(path => path.Contains(adjacente))) + foreach (List path in ropePaths) { + if (!path.Contains(adjacente)) continue; index=ropePaths.IndexOf(path); + return true; } - return index != -1; + return false; } public bool AsValue (Cell choosenCell, List> ropePaths,int index)