Add a setting to enable mod nav hacks

This commit is contained in:
codiac 2023-09-13 15:21:19 +10:00
parent 6266516ea1
commit 720a73cce2
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,7 @@
--License for code WTFPL and otherwise stated in readmes
local S = minetest.get_translator("mobs_mc")
local allow_nav_hacks = minetest.settings:get_bool("mcl_mob_allow_nav_hacks ",false)
--###################
--################### IRON GOLEM
@ -93,7 +94,7 @@ mcl_mobs.register_mob("mobs_mc:iron_golem", {
self.home_timer = 0
if self._home and self.state ~= "attack" then
local dist = vector.distance(self._home,self.object:get_pos())
if dist >= tele_dist then
if allow_nav_hacks and dist >= tele_dist then
self.object:set_pos(self._home)
self.state = "stand"
self.order = "follow"

View File

@ -173,6 +173,10 @@ mcl_mob_active_range (Active mob range) int 48 0 256
# Zombie siege raid (default:false)
mcl_raids_zombie_siege (Zombie siege raid) bool false
# Enable workarounds for faulty mob navigation.
# Hack 1: teleport golems home if they are very far from home
mcl_mob_allow_nav_hacks (Mob navigation hacks) bool false
[Audio]
# Enable flame sound.
flame_sound (Flame sound) bool true