From c9c81a610d97c95c15f938ecd07ceb71cb0cdfb1 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 24 Jun 2013 18:30:58 -0700 Subject: Fix bugs --- src/map/skill.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/map/skill.hpp') diff --git a/src/map/skill.hpp b/src/map/skill.hpp index 2823943..c5a2f03 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -3,6 +3,8 @@ #include "skill.t.hpp" +#include "../common/strings.hpp" + #include "map.hpp" constexpr int MAX_SKILL_PRODUCE_DB = 150; @@ -34,8 +36,13 @@ earray skill_db; struct skill_name_db { SkillID id; // skill id - std::string name; // search strings - std::string desc; // description that shows up for searches + FString name; // search strings + FString desc; // description that shows up for searches + + // this makes const char(&)[] not decay into const char * in {} + skill_name_db(SkillID i, FString n, FString d) + : id(i), name(n), desc(d) + {} }; // used only by @skillid for iteration - should be depublicized @@ -119,7 +126,7 @@ bool skill_pool_is_activated(dumb_ptr sd, SkillID skill); int skill_pool_deactivate(dumb_ptr sd, SkillID skill); // Yield configurable skill name inline -const std::string& skill_name(SkillID skill) +const FString& skill_name(SkillID skill) { return skill_lookup_by_id(skill).desc; } -- cgit v1.2.3-60-g2f50