fixup alignment_type function (returns const std::string now)

This fixes up 684d1c35c6.
gfgtdf was getting crashes in the help menu otherwise.
This commit is contained in:
Chris Beck 2014-05-26 14:34:55 -04:00
parent 793cbaf479
commit 0656e93134
2 changed files with 2 additions and 2 deletions

View file

@ -347,7 +347,7 @@ static config unit_alignment(const unit* u)
{
if (!u) return report();
std::ostringstream str, tooltip;
char const *align = unit_type::alignment_description(u->alignment(), u->gender());
std::string align = unit_type::alignment_description(u->alignment(), u->gender());
std::string align_id = lexical_cast<std::string>(u->alignment());
int cm = combat_modifier(resources::screen->displayed_unit_hex(), u->alignment(),
u->is_fearless());

View file

@ -243,7 +243,7 @@ public:
)
ALIGNMENT alignment() const { return alignment_; }
inline static const char* alignment_description(ALIGNMENT align, unit_race::GENDER gender = unit_race::MALE)
inline static std::string alignment_description(ALIGNMENT align, unit_race::GENDER gender = unit_race::MALE)
{
std::string str = std::string();
if (gender == unit_race::FEMALE) {