diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-10-05 18:45:08 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-10-05 18:45:08 +0200 |
commit | 667acd0e312301ad613b6a71f843c51d2062aee6 (patch) | |
tree | 5e93eef312d1c8a049161f040859ed2d1a0be850 /src/cmd4.cc | |
parent | 4b179786d73cde338e97503d036baea9015f655d (diff) |
Move d_info into GameEditData
Diffstat (limited to 'src/cmd4.cc')
-rw-r--r-- | src/cmd4.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/cmd4.cc b/src/cmd4.cc index 12d47324..b06947dc 100644 --- a/src/cmd4.cc +++ b/src/cmd4.cc @@ -14,6 +14,7 @@ #include "dungeon_info_type.hpp" #include "feature_type.hpp" #include "files.hpp" +#include "game.hpp" #include "hooks.hpp" #include "init1.hpp" #include "levels.hpp" @@ -2722,6 +2723,8 @@ static cptr do_cmd_feeling_text[11] = */ void do_cmd_feeling(void) { + auto const &d_info = game->edit_data.d_info; + /* Verify the feeling */ if (feeling < 0) feeling = 0; if (feeling > 10) feeling = 10; @@ -2763,7 +2766,7 @@ void do_cmd_feeling(void) { /* This could be simplified with a correct p_ptr->town_num */ int i, town_level = 0; - dungeon_info_type *d_ptr = &d_info[dungeon_type]; + auto d_ptr = &d_info[dungeon_type]; /* Is it a town level ? */ for (i = 0; i < TOWN_DUNGEON; i++) @@ -3625,10 +3628,12 @@ static void do_cmd_knowledge_objects(void) */ static void do_cmd_knowledge_dungeons(void) { + auto const &d_info = game->edit_data.d_info; + fmt::MemoryWriter w; /* Scan all dungeons */ - for (int y = 1; y < max_d_idx; y++) + for (std::size_t y = 1; y < d_info.size(); y++) { /* The dungeon has a valid recall depth set */ if (max_dlv[y]) @@ -3651,12 +3656,14 @@ static void do_cmd_knowledge_dungeons(void) */ void do_cmd_knowledge_towns(void) { + auto const &d_info = game->edit_data.d_info; + fmt::MemoryWriter w; /* Scan all dungeons */ - for (int i = 0; i < max_d_idx; i++) + for (auto const &d_ref: d_info) { - dungeon_info_type *d_ptr = &d_info[i]; + auto d_ptr = &d_ref; /* Scan all dungeon town slots */ for (int j = 0; j < TOWN_DUNGEON; j++) |