From c8e8401ac58bab9fcf91042a2f79f8a1a0ababab Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sun, 12 Mar 2023 11:35:21 +0000 Subject: [PATCH] add mob_height_fix setting so it can be disabled. --- api.lua | 5 +++-- api.txt | 2 ++ settingtypes.txt | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/api.lua b/api.lua index 3eeef26..0afe51a 100644 --- a/api.lua +++ b/api.lua @@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi") mobs = { mod = "redo", - version = "20230311", + version = "20230312", intllib = S, invis = minetest.global_exists("invisibility") and invisibility or {} } @@ -83,6 +83,7 @@ local active_limit = tonumber(settings:get("mob_active_limit") or 0) local mob_chance_multiplier = tonumber(settings:get("mob_chance_multiplier") or 1) local peaceful_player_enabled = settings:get_bool("enable_peaceful_player") local mob_smooth_rotate = settings:get_bool("mob_smooth_rotate") ~= false +local mob_height_fix = settings:get_bool("mob_height_fix") ~= false local active_mobs = 0 -- pathfinding settings @@ -3556,7 +3557,7 @@ function mobs:register_mob(name, def) local collisionbox = def.collisionbox or {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25} -- quick fix to stop mobs glitching through nodes if too small - if -collisionbox[2] + collisionbox[5] < 1.01 then + if mob_height_fix and -collisionbox[2] + collisionbox[5] < 1.01 then collisionbox[5] = collisionbox[2] + 0.99 end diff --git a/api.txt b/api.txt index ce6173f..983c43c 100644 --- a/api.txt +++ b/api.txt @@ -755,6 +755,8 @@ External Settings for "minetest.conf" mob for obstructions before spawning, otherwise it defaults to checking the height of the mob only. 'mob_smooth_rotate' Enables smooth rotation when mobs turn by default. + 'mob_height_fix' Enabled by default, increases smaller mob heights so they wont + glitch through certain nodes. 'mob_pathfinding_enable' Enable pathfinding. 'mob_pathfinder_enable' Use pathfinder mod if available. 'mob_pathfinding_stuck_timeout' How long before stuck mobs start searching. (default 3.0) diff --git a/settingtypes.txt b/settingtypes.txt index d912ea1..6078737 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -43,6 +43,9 @@ enable_peaceful_player (Mobs do not attack peaceful player without reason) bool # Enable mobs smooth rotation mob_smooth_rotate (Smooth rotation for mobs) bool true +# Fix Mob Height if too low so they cannot escape through specific nodes +mob_height_fix (Fix Mob Height) bool true + [Pathfinding] # Enable pathfinding (default Enabled) mob_pathfinding_enable (Enable pathfinding) bool true