summaryrefslogtreecommitdiff
path: root/src/init1.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-06-22 11:26:23 +0200
committerBardur Arantsson <bardur@scientician.net>2016-06-22 11:36:10 +0200
commit85143506abfb231a6ffc717a0ebc1a8339cd8a50 (patch)
tree26284a0695295d01164fff1d0f698c9934a8d8cb /src/init1.cc
parent2f7774c60767d5579af0596caadbb0f9ca822963 (diff)
Rework SKF1_* flags to flag_set<>
Diffstat (limited to 'src/init1.cc')
-rw-r--r--src/init1.cc54
1 files changed, 11 insertions, 43 deletions
diff --git a/src/init1.cc b/src/init1.cc
index ba13cfae..13a376d3 100644
--- a/src/init1.cc
+++ b/src/init1.cc
@@ -35,6 +35,7 @@
#include "randart_gen_type.hpp"
#include "randart_part_type.hpp"
#include "set_type.hpp"
+#include "skill_flag.hpp"
#include "skill_type.hpp"
#include "skills.hpp"
#include "spells5.hpp"
@@ -198,43 +199,6 @@ static cptr t_info_flags[] =
"XXX32"
};
-/* Skill flags */
-static cptr s_info_flags1[] =
-{
- "HIDDEN",
- "AUTO_HIDE",
- "RANDOM_GAIN",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1",
- "XXX1"
-};
-
/*
* Helpers for looking up flags in the above arrays
@@ -754,12 +718,16 @@ static errr grab_one_race_allow_flag(u32b *choice, cptr what)
/*
* Grab one flag from a textual string
*/
-static errr grab_one_skill_flag(u32b *f1, cptr what)
+static errr grab_one_skill_flag(skill_flag_set *flags, cptr what)
{
- if (lookup_flags(what, flag_tie(f1, s_info_flags1)))
- {
- return 0;
- }
+#define SKF(tier, index, name) \
+ if (streq(what, #name)) \
+ { \
+ *flags |= BOOST_PP_CAT(SKF_,name); \
+ return 0; \
+ };
+#include "skill_flag_list.hpp"
+#undef SKF
/* Oops */
msg_format("(2)Unknown skill flag '%s'.", what);
@@ -3590,7 +3558,7 @@ errr init_s_info_txt(FILE *fp)
/* Process 'F' for flags */
if (buf[0] == 'F')
{
- if (0 != grab_one_skill_flag(&s_ptr->flags1, buf + 2))
+ if (0 != grab_one_skill_flag(&s_ptr->flags, buf + 2))
{
return (5);
}