diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-05 14:47:58 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-05 14:47:58 +1000 |
commit | 75be79355430d15ed4783ef7fa2725a940642646 (patch) | |
tree | d9dc756443533b164a94884a216aea7c85f2597e /crawl-ref/source/dungeon.cc | |
parent | 98b441d511bd1538c6803f8fab3a7777c51dc90b (diff) | |
download | crawl-ref-75be79355430d15ed4783ef7fa2725a940642646.tar.gz crawl-ref-75be79355430d15ed4783ef7fa2725a940642646.zip |
Apply extra_monster_flags earlier to fix "comes into view" errors.
Rebranded monsters (ie, "kobold name:Durwent name_replace") who are
created with Lua and dgn.create_monster while the player is resting will
generate a "XYZ comes into view" warning message.
However, as this message is triggered by handle_seen_interrupt, which is
triggered before the additional flags are applied, it will disregard
MF_NAME_SUFFIX, MF_NAME_REPLACE, MF_NAME_ADJECTIVE, etc. Applying these
flags earlier fixes this.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 7640048c11..8c91a76616 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -4967,6 +4967,9 @@ int dgn_place_monster(mons_spec &mspec, if (m_band) mg.flags |= MG_PERMIT_BANDS; + // Store any extra flags here. + mg.extra_flags |= mspec.extra_monster_flags; + const int mindex = place_monster(mg, true); if (mindex != -1) { @@ -4975,7 +4978,9 @@ int dgn_place_monster(mons_spec &mspec, _dgn_give_mon_spec_items(mspec, mindex, mid, monster_level); if (mspec.explicit_spells) mons.spells = mspec.spells; - mons.flags |= mspec.extra_monster_flags; + // These are applied earlier to prevent issues with renamed monsters + // and "<monster> comes into view" (see delay.cc:_monster_warning). + //mons.flags |= mspec.extra_monster_flags; if (mons.is_priest() && mons.god == GOD_NO_GOD) mons.god = GOD_NAMELESS; } |