diff --git a/src/reports.cpp b/src/reports.cpp index 43db68a049b..a99e828823f 100644 --- a/src/reports.cpp +++ b/src/reports.cpp @@ -347,8 +347,8 @@ static config unit_alignment(const unit* u) { if (!u) return report(); std::ostringstream str, tooltip; - std::string align = unit_type::alignment_description(u->alignment(), u->gender()); - std::string align_id = lexical_cast(u->alignment()); + const std::string align = unit_type::alignment_description(u->alignment(), u->gender()); + const std::string align_id = lexical_cast(u->alignment()); int cm = combat_modifier(resources::screen->displayed_unit_hex(), u->alignment(), u->is_fearless()); diff --git a/src/unit_types.hpp b/src/unit_types.hpp index 4aa03e9849b..b4e18f8c06a 100644 --- a/src/unit_types.hpp +++ b/src/unit_types.hpp @@ -243,7 +243,7 @@ public: ) ALIGNMENT alignment() const { return alignment_; } - inline static std::string alignment_description(ALIGNMENT align, unit_race::GENDER gender = unit_race::MALE) + inline static const std::string alignment_description(ALIGNMENT align, unit_race::GENDER gender = unit_race::MALE) { std::string str = std::string(); if (gender == unit_race::FEMALE) {