add mob_height_fix setting so it can be disabled.

This commit is contained in:
tenplus1 2023-03-12 11:35:21 +00:00
parent 733672127c
commit c8e8401ac5
3 changed files with 8 additions and 2 deletions

View File

@ -25,7 +25,7 @@ local use_cmi = minetest.global_exists("cmi")
mobs = { mobs = {
mod = "redo", mod = "redo",
version = "20230311", version = "20230312",
intllib = S, intllib = S,
invis = minetest.global_exists("invisibility") and invisibility or {} 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 mob_chance_multiplier = tonumber(settings:get("mob_chance_multiplier") or 1)
local peaceful_player_enabled = settings:get_bool("enable_peaceful_player") local peaceful_player_enabled = settings:get_bool("enable_peaceful_player")
local mob_smooth_rotate = settings:get_bool("mob_smooth_rotate") ~= false 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 local active_mobs = 0
-- pathfinding settings -- 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} 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 -- 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 collisionbox[5] = collisionbox[2] + 0.99
end end

View File

@ -755,6 +755,8 @@ External Settings for "minetest.conf"
mob for obstructions before spawning, otherwise it mob for obstructions before spawning, otherwise it
defaults to checking the height of the mob only. defaults to checking the height of the mob only.
'mob_smooth_rotate' Enables smooth rotation when mobs turn by default. '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_pathfinding_enable' Enable pathfinding.
'mob_pathfinder_enable' Use pathfinder mod if available. 'mob_pathfinder_enable' Use pathfinder mod if available.
'mob_pathfinding_stuck_timeout' How long before stuck mobs start searching. (default 3.0) 'mob_pathfinding_stuck_timeout' How long before stuck mobs start searching. (default 3.0)

View File

@ -43,6 +43,9 @@ enable_peaceful_player (Mobs do not attack peaceful player without reason) bool
# Enable mobs smooth rotation # Enable mobs smooth rotation
mob_smooth_rotate (Smooth rotation for mobs) bool true 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] [Pathfinding]
# Enable pathfinding (default Enabled) # Enable pathfinding (default Enabled)
mob_pathfinding_enable (Enable pathfinding) bool true mob_pathfinding_enable (Enable pathfinding) bool true