summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monplace.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-16 03:58:13 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-16 03:58:13 +0000
commit61ebfeda71005384365b4598594e03bbdaec1e05 (patch)
treef0d0a77eb97de4fa73a8a8de22192f694421bb38 /crawl-ref/source/monplace.cc
parent545b45725085f4c2c09c2cf8275466b80645cb98 (diff)
downloadcrawl-ref-61ebfeda71005384365b4598594e03bbdaec1e05.tar.gz
crawl-ref-61ebfeda71005384365b4598594e03bbdaec1e05.zip
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
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r--crawl-ref/source/monplace.cc13
1 files changed, 8 insertions, 5 deletions
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<int> 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;