Skip to content

Commit

Permalink
Merge pull request #2393 from lmoureaux/bugfix/roads
Browse files Browse the repository at this point in the history
Fix drawing AllSeparate roads in hex mode
  • Loading branch information
hugomflavio authored Sep 22, 2024
2 parents 70858be + 5984440 commit 193120d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/tileset/layer_roads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::bitset<DIR8_MAGIC_MAX>, bool>
road_data(const struct tileset *t, const tile *ptile,
Expand Down Expand Up @@ -445,9 +447,8 @@ void layer_roads::fill_all_separate(std::vector<drawn_sprite> &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]);
}
}

Expand Down

0 comments on commit 193120d

Please sign in to comment.