summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-24 02:57:02 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-24 02:57:02 +0000
commitaf9636ebc2cfe2b17cee45601031c0c84e661ec0 (patch)
tree68335dddfefbad82fe7466911d83cfd2dfb55353 /crawl-ref
parent577db650c981247a5f625dc5da51b2b519830cff (diff)
downloadcrawl-ref-af9636ebc2cfe2b17cee45601031c0c84e661ec0.tar.gz
crawl-ref-af9636ebc2cfe2b17cee45601031c0c84e661ec0.zip
Clean up a bit more summoning code.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4576 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/spells3.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 8f725bbf96..b532c5ba06 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -476,7 +476,8 @@ void dancing_weapon(int pow, bool force_hostile)
int numsc = std::min(2 + (random2(pow) / 5), 6);
int summs = 0;
- beh_type behavi = BEH_FRIENDLY;
+ beh_type beha = BEH_FRIENDLY;
+ int hitting = you.pet_target;
bool failed = false;
const int wpn = you.equip[EQ_WEAPON];
@@ -500,10 +501,13 @@ void dancing_weapon(int pow, bool force_hostile)
// cursed weapons become hostile
if (item_cursed( you.inv[wpn] ) || force_hostile)
- behavi = BEH_HOSTILE;
+ {
+ beha = BEH_HOSTILE;
+ hitting = MHITYOU;
+ }
- summs = create_monster( MONS_DANCING_WEAPON, numsc, behavi,
- you.x_pos, you.y_pos, you.pet_target, 1 );
+ summs = create_monster( MONS_DANCING_WEAPON, numsc, beha,
+ you.x_pos, you.y_pos, hitting, 1 );
if ( summs == -1 )
failed = true;
}