mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-02 00:10:21 +02:00
Added attack_animals flag for monsters
This commit is contained in:
7
api.lua
7
api.lua
@ -987,7 +987,8 @@ local monster_attack = function(self)
|
||||
|
||||
local s = self.object:getpos()
|
||||
local p, sp, dist
|
||||
local player, type, obj, min_player
|
||||
local player, obj, min_player
|
||||
local type = ""
|
||||
local min_dist = self.view_range + 1
|
||||
local objs = minetest.get_objects_inside_radius(s, self.view_range)
|
||||
|
||||
@ -1012,7 +1013,8 @@ local monster_attack = function(self)
|
||||
end
|
||||
|
||||
if type == "player"
|
||||
or type == "npc" then
|
||||
or type == "npc"
|
||||
or (type == "animal" and self.attack_animals == true) then
|
||||
|
||||
s = self.object:getpos()
|
||||
p = player:getpos()
|
||||
@ -2323,6 +2325,7 @@ minetest.register_entity(name, {
|
||||
dogshoot_switch = def.dogshoot_switch,
|
||||
dogshoot_count = 0,
|
||||
dogshoot_count_max = def.dogshoot_count_max or 5,
|
||||
attack_animals = def.attack_animals or false,
|
||||
|
||||
on_blast = def.on_blast or do_tnt,
|
||||
|
||||
|
Reference in New Issue
Block a user