diff --git a/client/tileset/layer_roads.cpp b/client/tileset/layer_roads.cpp index 041c1b2468..1d2ef97725 100644 --- a/client/tileset/layer_roads.cpp +++ b/client/tileset/layer_roads.cpp @@ -247,6 +247,8 @@ bool should_draw(const struct tileset *t, const extra_type *extra, * Returns data needed to draw roads on a tile. This is the directions in * which roads should be drawn, and whether an "isolated" road should be * drawn. + * + * The returned array is indexed in the tileset *valid* directions. */ std::tuple, bool> road_data(const struct tileset *t, const tile *ptile, @@ -445,9 +447,8 @@ void layer_roads::fill_all_separate(std::vector &sprs, // Draw the sprites for (int i = 0; i < tileset_num_valid_dirs(tileset()); ++i) { - auto dir = tileset_valid_dirs(tileset())[i]; - if (draw[dir]) { - sprs.emplace_back(tileset(), data.sprites[dir]); + if (draw[i]) { + sprs.emplace_back(tileset(), data.sprites[i]); } }