Skip to content

Commit

Permalink
fix(port): failed assert when placing special in overmap editor (#3853)
Browse files Browse the repository at this point in the history
Fix crash when placing special in overmap editor (#52762)

Co-authored-by: Binrui Dong <[email protected]>
  • Loading branch information
Vollch and BrettDong authored Dec 9, 2023
1 parent 0c3f048 commit 2dc70ae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/overmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,12 @@ struct fixed_overmap_special_data : overmap_special_data {
}

std::vector<overmap_special_terrain> preview_terrains() const override {
return terrains;
std::vector<overmap_special_terrain> result;
std::copy_if( terrains.begin(), terrains.end(), std::back_inserter( result ),
[]( const overmap_special_terrain & terrain ) {
return terrain.p.z == 0;
} );
return result;
}

std::vector<overmap_special_locations> required_locations() const override {
Expand Down

0 comments on commit 2dc70ae

Please sign in to comment.