diff options
author | gammafunk <gammafunk@gmail.com> | 2014-07-12 05:19:57 -0500 |
---|---|---|
committer | gammafunk <gammafunk@gmail.com> | 2014-07-12 05:50:05 -0500 |
commit | d3fc6c344ce003338835473d0598ed24bfc532e7 (patch) | |
tree | f575f0d3ba7ed9bc9284fb45fc95a3099ba591d5 /crawl-ref/source/dbg-maps.cc | |
parent | f27aa039430108952b13c62a76e98b2885935a5d (diff) | |
download | crawl-ref-d3fc6c344ce003338835473d0598ed24bfc532e7.tar.gz crawl-ref-d3fc6c344ce003338835473d0598ed24bfc532e7.zip |
Record objects for objstat after the level builder has completed
Previously we were recording during the monster and item creation
functions, but this resulted in some excess counting, due to
(probably) objects placed in vaults on levels that were eventually
rejected. We now iterate over objects after the level generation is
complete.
Diffstat (limited to 'crawl-ref/source/dbg-maps.cc')
-rw-r--r-- | crawl-ref/source/dbg-maps.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc index 7ebaf8f55d..ddb443adb3 100644 --- a/crawl-ref/source/dbg-maps.cc +++ b/crawl-ref/source/dbg-maps.cc @@ -10,6 +10,7 @@ #include "branch.h" #include "chardump.h" #include "crash.h" +#include "dbg-scan.h" #include "dungeon.h" #include "env.h" #include "initfile.h" @@ -113,11 +114,29 @@ static bool _do_build_level() default: break; } - // Turn any mimics into actual monsters so they'll be recorded - // by objstat. - discover_mimic(coord_def(x, y), false); + if (crawl_state.obj_stat_gen) + { + coord_def pos(x, y); + // Turn any mimics into actual monsters so they'll be recorded. + discover_mimic(pos, false); + monster *mons = monster_at(pos); + if (mons) + objstat_record_monster(mons); + + } } + // Record items for objstat + if (crawl_state.obj_stat_gen) + { + for (int i = 0; i < MAX_ITEMS; ++i) + { + if (!mitm[i].defined()) + continue; + objstat_record_item(mitm[i]); + } + } + { unwind_bool wiz(you.wizard, true); magic_mapping(1000, 100, true, true, false, |