summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/directn.cc7
-rw-r--r--crawl-ref/source/directn.h6
2 files changed, 12 insertions, 1 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 665f41c81b..7545738668 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -129,6 +129,13 @@ static void _describe_oos_square(const coord_def& where);
static void _extend_move_to_edge(dist &moves);
static std::string _get_monster_desc(const monsters *mon);
+dist::dist()
+ : isValid(false), isTarget(false), isMe(false), isEndpoint(false),
+ isCancel(true), choseRay(false), target(), delta(), ray(),
+ prev_target(MHITNOT)
+{
+}
+
void direction_choose_compass( dist& moves, targetting_behaviour *beh)
{
moves.isValid = true;
diff --git a/crawl-ref/source/directn.h b/crawl-ref/source/directn.h
index 13b2dd7c60..500b6089cb 100644
--- a/crawl-ref/source/directn.h
+++ b/crawl-ref/source/directn.h
@@ -40,8 +40,12 @@ public:
};
// output from direction() function:
-struct dist
+class dist
{
+public:
+ dist();
+
+public:
bool isValid; // valid target chosen?
bool isTarget; // target (true), or direction (false)?
bool isMe; // selected self (convenience: target == you.pos())