summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-06-09 18:48:38 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2016-06-09 18:48:38 +0100
commit54beb82686c6bb470a4463d04963d8ed9c07757f (patch)
tree2b40c93fe031865eb052bc96a5d9e1c1a46557a5
parentd281ad3bb165a94caf75aab006599f5ac8b633ad (diff)
stop attacking when player turns invisible
-rw-r--r--api.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/api.lua b/api.lua
index 9f1ca1a..cf96a74 100644
--- a/api.lua
+++ b/api.lua
@@ -1342,7 +1342,8 @@ local do_states = function(self, dtime)
if dist > self.view_range
or not self.attack
or not self.attack:getpos()
- or self.attack:get_hp() <= 0 then
+ or self.attack:get_hp() <= 0
+ or (self.attack:is_player() and invisibility[ self.attack:get_player_name() ]) then
--print(" ** stop attacking **", dist, self.view_range)
self.state = "stand"