1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-07-01 22:30:21 +02:00

simplify function

Simplify set_textures function (thx Sfan5)
This commit is contained in:
tenplus1
2023-09-04 07:49:59 +01:00
committed by GitHub
parent bb4ef43fb5
commit 76cc86c827

View File

@ -79,19 +79,12 @@ end
local function set_textures(images, worldaligntex)
local stair_images = {}
for i, image in ipairs(images) do
if type(image) == "string" then
stair_images[i] = {name = image, backface_culling = true}
if worldaligntex then
stair_images[i].align_style = "world"
end
else
stair_images[i] = table.copy(image)
if stair_images[i].backface_culling == nil then
stair_images[i].backface_culling = true
end
if worldaligntex and stair_images[i].align_style == nil then
stair_images[i].align_style = "world"
end
stair_images[i] = type(image) == "string" and {name = image} or table.copy(image)
if stair_images[i].backface_culling == nil then
stair_images[i].backface_culling = true
end
if worldaligntex and stair_images[i].align_style == nil then
stair_images[i].align_style = "world"
end
end
return stair_images