Skip to content

Commit

Permalink
OverlaysTweak
Browse files Browse the repository at this point in the history
Males and females can have separate overlays now.
  • Loading branch information
Robik81 committed Sep 26, 2014
1 parent 905636e commit 582f925
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,11 +1150,17 @@ void cata_tiles::draw_entity_with_overlays(int x, int y) {
// next up, draw all the overlays
std::vector<std::string> overlays = entity_to_draw->get_overlay_ids();
for(const std::string& overlay : overlays) {
// TODO: distinguish between male/female?
std::string draw_id = "overlay_"+overlay;
bool exists = true;
std::string draw_id = (entity_to_draw->male) ? "overlay_male_" + overlay : "overlay_female_" + overlay;
if (tile_ids.find(draw_id) == tile_ids.end()) {
draw_id = "overlay_" + overlay;
if(tile_ids.find(draw_id) == tile_ids.end()) {
exists = false;
}
}

// make sure we don't draw an annoying "unknown" tile when we have nothing to draw
if(tile_ids.find(draw_id) != tile_ids.end()) {
if (exists) {
draw_from_id_string(draw_id, C_NONE, "", x, y, corner, 0);
}
}
Expand Down

0 comments on commit 582f925

Please sign in to comment.