summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.h
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-11-26 10:39:08 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-11-27 00:51:03 +0100
commite9f04152f692786698ac769cb448d1c871d6bca9 (patch)
tree8434a692fc527ba10d51ff135ff9429a4b7f433b /crawl-ref/source/mon-util.h
parent21bfb98905bc6b7aba60f273e60605455d84b42c (diff)
downloadcrawl-ref-e9f04152f692786698ac769cb448d1c871d6bca9.tar.gz
crawl-ref-e9f04152f692786698ac769cb448d1c871d6bca9.zip
Make ENCH_SLEEPY a flag rather an enchantment.
This way it can get cleared a lot faster: we have a loop to remove it from every monster every turn, which shows up this prominently on qw profiles: [4] 59.6 0.07 14.57 21662 handle_monsters(bool) [4] 0.31 9.15 1263185/2072593 monster::del_ench(enchant_type, bool, bool) This commit merely optimizes it without improving the complexity: inventing some field last_slept could allow setting this only when the monster gets hibernated. For now I went the easy but lame way; having the query encapsulated means a stronger optimization can be done easier.
Diffstat (limited to 'crawl-ref/source/mon-util.h')
-rw-r--r--crawl-ref/source/mon-util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index cf8f587869..3728ca85ff 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -356,6 +356,7 @@ bool mons_is_lurking(const monster* m);
bool mons_is_batty(const monster* m);
bool mons_is_influenced_by_sanctuary(const monster* m);
bool mons_is_fleeing_sanctuary(const monster* m);
+bool mons_just_slept(const monster* m);
bool mons_class_is_slime(monster_type mc);
bool mons_is_slime(const monster* mon);
bool mons_class_is_plant(monster_type mc);