diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-21 16:55:29 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-21 16:55:29 +0000 |
commit | ca2fa8e5208ae5882a352193dcbdca194c59e3b7 (patch) | |
tree | 4d61bed1b033e96dccc2f2bdf9dd706883d24293 | |
parent | cccca0ee430d29e8c81e78be8b51cfcaa283bd6d (diff) | |
download | crawl-ref-ca2fa8e5208ae5882a352193dcbdca194c59e3b7.tar.gz crawl-ref-ca2fa8e5208ae5882a352193dcbdca194c59e3b7.zip |
Simplify.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4443 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/monstuff.cc | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 5223a63394..045178f789 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1961,23 +1961,15 @@ void behaviour_event( monsters *mon, int event, int src, int src_x, int src_y ) { bool isSmart = (mons_intel(mon->type) > I_ANIMAL); - bool isFriendly = mons_friendly(mon); bool wontAttack = mons_wont_attack(mon); - bool sourceFriendly = false; bool sourceWontAttack = false; bool setTarget = false; bool breakCharm = false; if (src == MHITYOU) - { - sourceFriendly = true; sourceWontAttack = true; - } else if (src != MHITNOT) - { - sourceFriendly = mons_friendly( &menv[src] ); sourceWontAttack = mons_wont_attack( &menv[src] ); - } switch(event) { @@ -2005,10 +1997,8 @@ void behaviour_event( monsters *mon, int event, int src, // or else fleeing anyway. Hitting someone over // the head, of course, always triggers this code. if (event == ME_WHACK - || (((isFriendly != sourceFriendly && - wontAttack != sourceWontAttack) || isSmart) - && mon->behaviour != BEH_FLEE - && mon->behaviour != BEH_PANIC)) + || ((wontAttack != sourceWontAttack || isSmart) + && mon->behaviour != BEH_FLEE && mon->behaviour != BEH_PANIC)) { // (plain) plants and fungi cannot flee or fight back if (mon->type == MONS_FUNGUS || mon->type == MONS_PLANT) |