Entered() and Exited() are never called if you modify loc directly. Instead of what you have, do this:
area var/pacify = 0
mob/proc/attack(var/mob/M) //get the area we're standing in (or what should be an area) var/area/A = loc.loc //if the area is pacified (or loc.loc isn't an area, meaning we're in the contents of something else), return if(!isarea(A) || A.pacify) return //attack stuff here