From 847b1da2f7ac9441a1a79b6b60402b45e2032ffd Mon Sep 17 00:00:00 2001 From: ShadowOfHassen Date: Thu, 29 Feb 2024 20:55:39 +0000 Subject: [PATCH] Update api.lua --- api.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index d0f1364..c9df8b5 100644 --- a/api.lua +++ b/api.lua @@ -134,6 +134,7 @@ mobs.mob_class = { owner = "", order = "", jump_height = 4, + alliance = nil, lifetimer = 180, -- 3 minutes texture_mods = "", view_range = 5, @@ -191,7 +192,6 @@ mobs.mob_class = { attack_animals = false, attack_players = true, attack_npcs = true, - attack_allies = false, friendly_fire = true, facing_fence = false, _breed_countdown = nil, @@ -1914,7 +1914,7 @@ function mob_class:general_attack() or (not self.attack_animals and ent.type == "animal") or (not self.attack_monsters and ent.type == "monster") or (not self.attack_npcs and ent.type == "npc") - or (not self.attack_allies and self.alliance == ent.alliance) + or (not self.alliance == nil and self.alliance == ent.alliance) or (self.specific_attack and not check_for(ent.name, self.specific_attack)) then objs[n] = nil --print("- mob", n, self.name, ent.name) @@ -3605,7 +3605,7 @@ minetest.register_entity(":" .. name, setmetatable({ }, name = name, - alliance = def.allaince, + alliance = def.alliance, type = def.type, _nametag = def.nametag, attack_type = def.attack_type, @@ -3691,7 +3691,6 @@ minetest.register_entity(":" .. name, setmetatable({ attack_animals = def.attack_animals, attack_players = def.attack_players, attack_npcs = def.attack_npcs, - attack_allies = def.attack_allies, specific_attack = def.specific_attack, friendly_fire = def.friendly_fire, runaway_from = def.runaway_from,