Merge pull request 'Re-enable mob spawning and neutral mob switch' (#1630) from jordan4ibanez/MineClone2:mineclone5 into mineclone5

Reviewed-on: MineClone2/MineClone2#1630
This commit is contained in:
jordan4ibanez 2021-04-23 22:35:14 +00:00
commit ae2a539d85
2 changed files with 15 additions and 2 deletions

View File

@ -64,6 +64,21 @@ mobs.mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
return return
end end
--neutral passive mobs switch to neutral hostile
if self.neutral then
--drop in variables for attacking (stops crash)
self.attacking = hitter
self.punch_timer = 0
self.hostile = true
--hostile_cooldown timer is initialized here
self.hostile_cooldown_timer = self.hostile_cooldown
--initialize the group attack (check for other mobs in area, make them neutral hostile)
if self.group_attack then
mobs.group_attack_initialization(self)
end
end
--turn skittish mobs away and RUN --turn skittish mobs away and RUN
if self.skittish then if self.skittish then

View File

@ -165,8 +165,6 @@ Overworld regular:
local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false local mobs_spawn = minetest.settings:get_bool("mobs_spawn", true) ~= false
mobs_spawn = false
-- count how many mobs are in an area -- count how many mobs are in an area
local count_mobs = function(pos) local count_mobs = function(pos)
local num = 0 local num = 0