mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-07 06:06:10 -04:00
Add option for non-jumpable fences and walls
Add an option, default disabled, to extend the collision boxes upwards.
This commit is contained in:
parent
1f7ea89cb6
commit
c42a525ce8
5 changed files with 68 additions and 35 deletions
|
@ -2,10 +2,11 @@
|
|||
|
||||
walls = {}
|
||||
|
||||
local fence_collision_extra = minetest.settings:get_bool("enable_fence_tall") and 3/8 or 0
|
||||
|
||||
-- Load support for MT game translation.
|
||||
local S = minetest.get_translator("walls")
|
||||
|
||||
|
||||
walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wall_sounds)
|
||||
--make wall_texture_table paramenter backwards compatible for mods passing single texture
|
||||
if type(wall_texture_table) ~= "table" then
|
||||
|
@ -17,12 +18,22 @@ walls.register = function(wall_name, wall_desc, wall_texture_table, wall_mat, wa
|
|||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {{-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}},
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4},
|
||||
-- connect_bottom =
|
||||
connect_front = {{-3/16, -1/2, -1/2, 3/16, 3/8, -1/4}},
|
||||
connect_left = {{-1/2, -1/2, -3/16, -1/4, 3/8, 3/16}},
|
||||
connect_back = {{-3/16, -1/2, 1/4, 3/16, 3/8, 1/2}},
|
||||
connect_right = {{ 1/4, -1/2, -3/16, 1/2, 3/8, 3/16}},
|
||||
connect_front = {-3/16, -1/2, -1/2, 3/16, 3/8, -1/4},
|
||||
connect_left = {-1/2, -1/2, -3/16, -1/4, 3/8, 3/16},
|
||||
connect_back = {-3/16, -1/2, 1/4, 3/16, 3/8, 1/2},
|
||||
connect_right = { 1/4, -1/2, -3/16, 1/2, 3/8, 3/16},
|
||||
},
|
||||
collision_box = {
|
||||
type = "connected",
|
||||
fixed = {-1/4, -1/2, -1/4, 1/4, 1/2 + fence_collision_extra, 1/4},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {-1/4,-1/2,-1/2,1/4,1/2 + fence_collision_extra,-1/4},
|
||||
connect_left = {-1/2,-1/2,-1/4,-1/4,1/2 + fence_collision_extra,1/4},
|
||||
connect_back = {-1/4,-1/2,1/4,1/4,1/2 + fence_collision_extra,1/2},
|
||||
connect_right = {1/4,-1/2,-1/4,1/2,1/2 + fence_collision_extra,1/4},
|
||||
},
|
||||
connects_to = { "group:wall", "group:stone", "group:fence" },
|
||||
paramtype = "light",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue