Skip to content

Commit

Permalink
Merge pull request #36322 from ipcyborg/fix-36236-safe-mode
Browse files Browse the repository at this point in the history
Fixed `safemode doesn't work if compass is hidden #36236`
  • Loading branch information
kevingranade authored Dec 30, 2019
2 parents 775e2d4 + 4c11a48 commit 0eecf62
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 136 deletions.
24 changes: 24 additions & 0 deletions src/avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,29 @@ class JsonObject;
class JsonOut;
class mission;
class npc;
class monster;
namespace debug_menu
{
class mission_debug;
} // namespace debug_menu
struct points_left;
struct mtype;

// Monster visible in different directions (safe mode & compass)
struct monster_visible_info {
// New monsters visible from last update
std::vector<shared_ptr_fast<monster>> new_seen_mon;

// Unique monsters (and types of monsters) visible in different directions
// 7 0 1 unique_types uses these indices;
// 6 8 2 0-7 are provide by direction_from()
// 5 4 3 8 is used for local monsters (for when we explain them below)
std::vector<npc *> unique_types[9];
std::vector<const mtype *> unique_mons[9];

// If the moster visible in this direction is dangerous
bool dangerous[8];
};

class avatar : public player
{
Expand Down Expand Up @@ -187,6 +205,10 @@ class avatar : public player
bool invoke_item( item *, const std::string &, const tripoint &pt ) override;
bool invoke_item( item *, const std::string & ) override;

monster_visible_info &get_mon_visible() {
return mon_visible;
}

private:
map_memory player_map_memory;
bool show_map_memory;
Expand Down Expand Up @@ -224,6 +246,8 @@ class avatar : public player
int dex_upgrade = 0;
int int_upgrade = 0;
int per_upgrade = 0;

monster_visible_info mon_visible;
};

struct points_left {
Expand Down
Loading

0 comments on commit 0eecf62

Please sign in to comment.