Help Browser: only show one image if male and female are the same

If a unit type has male and female versions, then two images of the unit are
displayed at the top-left of the help page. However, it did this even if the
two images were the same, which made the duplication look like a bug.

The Naga Fighter is one of the affected unit types.
This commit is contained in:
Steve Cotton 2023-11-07 11:59:12 +01:00 committed by Steve Cotton
parent 60f58c9694
commit bf89dfb818
2 changed files with 3 additions and 2 deletions

View file

@ -0,0 +1,2 @@
### User interface
* The help browser, when looking at a unit type which uses the same image for male and female units, now only shows one image instead of showing a duplicate.

View file

@ -302,8 +302,7 @@ std::string unit_topic_generator::operator()() const {
if (screen_width >= 1200) ss << "~XBRZ(2)";
ss << "' box='no'</img> ";
if (&female_type != &male_type) {
if (female_type.image() != male_type.image()) {
ss << "<img>src='" << female_type.image();
ss << "~RC(" << female_type.flag_rgb() << ">red)";
if (screen_width >= 1200) ss << "~XBRZ(2)";