summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
committerBardur Arantsson <bardur@scientician.net>2016-09-17 09:58:14 +0200
commite569b328d76c7437018eb11efcc0aa10bbd91de6 (patch)
treeae652a702a6c13cb09bf0c154e14335f4ea75f31
parent6e8536619890fbf36b6a890a92627d87b8b92842 (diff)
Use 'bool' in random_quest struct
-rw-r--r--src/loadsave.cc18
-rw-r--r--src/q_rand.cc6
-rw-r--r--src/random_quest.hpp2
3 files changed, 22 insertions, 4 deletions
diff --git a/src/loadsave.cc b/src/loadsave.cc
index 8bea40f4..73429be4 100644
--- a/src/loadsave.cc
+++ b/src/loadsave.cc
@@ -145,6 +145,24 @@ static void do_bool(bool_ *f, ls_flag_t flag)
}
}
+static void do_bool(bool *x, ls_flag_t flag)
+{
+ switch (flag)
+ {
+ case ls_flag_t::LOAD:
+ {
+ *x = (sf_get() != 0);
+ return;
+ }
+ case ls_flag_t::SAVE:
+ {
+ byte val = (*x) ? 1 : 0;
+ sf_put(val);
+ return;
+ }
+ }
+}
+
static void do_u16b(u16b *v, ls_flag_t flag)
{
switch (flag)
diff --git a/src/q_rand.cc b/src/q_rand.cc
index af58309d..e48fec98 100644
--- a/src/q_rand.cc
+++ b/src/q_rand.cc
@@ -182,7 +182,7 @@ void initialize_random_quests(int n)
r_ptr->max_num = -1;
}
- q_ptr->done = FALSE;
+ q_ptr->done = false;
if (wizard)
{
@@ -314,7 +314,7 @@ static void princess_death(s32b m_idx, s32b r_idx)
do_get_new_obj(y, x);
- random_quests[dun_level].done = TRUE;
+ random_quests[dun_level].done = true;
break;
}
@@ -323,7 +323,7 @@ static void princess_death(s32b m_idx, s32b r_idx)
static void hero_death(s32b m_idx, s32b r_idx)
{
- random_quests[dun_level].done = TRUE;
+ random_quests[dun_level].done = true;
cmsg_print(TERM_YELLOW, "The adventurer steps out of the shadows and picks up his sword:");
cmsg_print(TERM_YELLOW, "'Ah! My sword! My trusty sword! Thanks.");
diff --git a/src/random_quest.hpp b/src/random_quest.hpp
index 11ebe797..9e3c6e10 100644
--- a/src/random_quest.hpp
+++ b/src/random_quest.hpp
@@ -6,5 +6,5 @@ struct random_quest
{
byte type; /* Type/number of monsters to kill(0 = no quest) */
s16b r_idx; /* Monsters to crush */
- bool_ done; /* Done ? */
+ bool done; /* Done? */
};