Skip to content

Commit 71938ca

Browse files
committed
fix cannot see wall in ttwars
1 parent 2989842 commit 71938ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

TTWarsCore/Parsers/VillageInfrastructure.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@ public static List<HtmlNode> GetBuildingNodes(HtmlDocument doc)
1111
{
1212
var villageContentNode = doc.GetElementbyId("village_map");
1313
if (villageContentNode is null) return new();
14-
return villageContentNode.Descendants("div").Where(x => x.HasClass("buildingSlot")).ToList();
14+
var list = villageContentNode.Descendants("div").Where(x => x.HasClass("buildingSlot")).ToList();
15+
if (list.Count == 22) return list;
16+
list.RemoveAt(22);
17+
return list;
1518
}
1619

1720
public static int GetId(HtmlNode node)
1821
{
1922
var classess = node.GetClasses();
20-
var needClass = classess.FirstOrDefault(x => x.StartsWith("aid"));
23+
var needClass = classess.FirstOrDefault(x => x.StartsWith("a"));
2124
if (string.IsNullOrEmpty(needClass)) return -1;
2225
var strResult = new string(needClass.Where(c => char.IsDigit(c)).ToArray());
2326
if (string.IsNullOrEmpty(strResult)) return -1;

0 commit comments

Comments
 (0)