Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
[mobs] Uncomment half of attack stop
Browse files Browse the repository at this point in the history
 - ... but only for non-explosive mobs
 - #509 , following the advice of @Crabman77
  • Loading branch information
Lymkwi committed Oct 6, 2016
1 parent 327694b commit 7ddebdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mods/mobs/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,11 @@ minetest.register_entity(name, {
local p = self.attack:getpos() or s
local dist = get_distance(p, s)

--[[ stop attacking if player or out of range
if dist > self.view_range
-- stop attacking if player or out of range
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) and not self.attack_type == "explode" then -- MFF

--print(" ** stop attacking **", dist, self.view_range)
self.state = "stand"
Expand All @@ -1504,7 +1504,7 @@ minetest.register_entity(name, {
self.blinktimer = 0

return
end]] -- MFF(Mg|06/10/2016) #509
end

if self.attack_type == "explode" then

Expand Down

0 comments on commit 7ddebdd

Please sign in to comment.