private void ClearPathAll() { // we want to clear only tiles with type path, path_past & path_current TDTile[,] tiles = map.GetTiles(); for (int y = 0; y < gridSizeZ; y++) { for (int x = 0; x < gridSizeX; x++) { if (tiles[y, x].GetTileType() != (int)TILE_TYPE.ENDPOINT && (tiles[y, x].GetTileType() == (int)TILE_TYPE.PATH || tiles[y, x].GetTileType() == (int)TILE_TYPE.PATH_CURRENT || tiles[y, x].GetTileType() == (int)TILE_TYPE.PATH_NEXT)) { SetTileTexture(tiles[y, x], tiles[y, x].GetOldTileType(), tiles[y, x].GetX(), tiles[y, x].GetY()); } } } map.ClearPath(); }