Fix bug non found villages
This commit is contained in:
@@ -833,10 +833,8 @@ function handleAutoPlanerSubmit(event) {
|
||||
let doc = parser.parseFromString(xhr.responseText, "text/html");
|
||||
let mapContainer = doc.getElementById("mapContainer");
|
||||
let map = mapContainer.getElementsByTagName("table")[1];
|
||||
let mapRows = map.getElementsByTagName("tr");
|
||||
let mapRow = mapRows[Math.floor(mapRows.length / 2) - 1];
|
||||
let mapCells = mapRow.getElementsByTagName("td");
|
||||
let mapCell = mapCells[Math.floor(mapCells.length / 2) + 1];
|
||||
let tbody = map.getElementsByTagName("tbody")[0];
|
||||
let mapCell = tbody.children[6].children[8];
|
||||
let mapLinks = mapCell.getElementsByTagName("a");
|
||||
if (mapLinks.length === 0) {
|
||||
autoPlanerError.textContent = "Opération impossible car le village cible n'existe pas!";
|
||||
|
||||
Reference in New Issue
Block a user