From 61ebfeda71005384365b4598594e03bbdaec1e05 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 16 Dec 2008 03:58:13 +0000 Subject: Merge r7836: divine summons should drop non-summoned items on death (FR #2424917), summoned items should vanish when dropped/fired/thrown by monsters. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7844 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monplace.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/monplace.cc') diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 232e64da02..119887fefa 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -922,19 +922,23 @@ static int _place_monster_aux( const mgen_data &mg, menv[id].flags |= MF_JUST_SUMMONED; + // dur should always be 1-6 for monsters that can be abjured. + const bool summoned = mg.abjuration_duration >= 1 + && mg.abjuration_duration <= 6; + if (mg.cls == MONS_DANCING_WEAPON && mg.number != 1) // ie not from spell { - give_item( id, mg.power ); + give_item( id, mg.power, summoned ); if (menv[id].inv[MSLOT_WEAPON] != NON_ITEM) menv[id].colour = mitm[ menv[id].inv[MSLOT_WEAPON] ].colour; } else if (mons_itemuse(mg.cls) >= MONUSE_STARTING_EQUIPMENT) { - give_item( id, mg.power ); + give_item( id, mg.power, summoned ); // Give these monsters a second weapon -- bwr if (mons_wields_two_weapons(mg.cls)) - give_item( id, mg.power ); + give_item( id, mg.power, summoned ); unwind_var save_speedinc(menv[id].speed_increment); menv[id].wield_melee_weapon(false); @@ -970,8 +974,7 @@ static int _place_monster_aux( const mgen_data &mg, menv[id].behaviour = BEH_WANDER; } - // dur should always be 1-6 for monsters that can be abjured. - if (mg.abjuration_duration >= 1 && mg.abjuration_duration <= 6) + if (summoned) menv[id].mark_summoned( mg.abjuration_duration, true ); menv[id].foe = mg.foe; -- cgit v1.2.3-54-g00ecf