Fix group attack for slime, zombie and zombiepig
This commit is contained in:
parent
f3b4c56772
commit
47ef78bf6a
5 changed files with 20 additions and 10 deletions
|
@ -2569,12 +2569,20 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
|||
|
||||
if obj then
|
||||
|
||||
-- only alert members of same mob
|
||||
if obj.group_attack == true
|
||||
-- only alert members of same mob or friends
|
||||
if obj.group_attack
|
||||
and obj.state ~= "attack"
|
||||
and obj.owner ~= name
|
||||
and obj.name == self.name then
|
||||
do_attack(obj, hitter)
|
||||
and obj.owner ~= name then
|
||||
if obj.name == self.name then
|
||||
do_attack(obj, hitter)
|
||||
elseif type(obj.group_attack) == "table" then
|
||||
for i=1, #obj.group_attack do
|
||||
if obj.name == obj.group_attack[i] then
|
||||
do_attack(obj, hitter)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- have owned mobs attack player threat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue