summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index df3bf61b6a..1019d862a0 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3645,7 +3645,13 @@ bool you_attack(int monster_attacked, bool unarmed_attacks)
// check if the player is fighting with something unsuitable
wielded_weapon_check(attk.weapon);
- return attk.attack();
+ bool attack = attk.attack();
+ if (attack && (is_sanctuary(you.x_pos, you.y_pos)
+ || is_sanctuary(defender->x, defender->y)))
+ {
+ remove_sanctuary(true);
+ }
+ return attack;
}
// Lose attack energy for attacking with a weapon. The monster has already lost