simplify set_textures function (thx Sfan5)

This commit is contained in:
tenplus1 2023-09-04 07:52:26 +01:00
parent 70533a8f5f
commit ff17029c9d

View File

@ -19,25 +19,17 @@ local set_textures = function(images, worldaligntex)
local stair_images = {}
for i, image in ipairs(images) do
if type(image) == "string" then
stair_images[i] = type(image) == "string" and {name = image} or table.copy(image)
stair_images[i] = {name = image, backface_culling = true}
if stair_images[i].backface_culling == nil then
stair_images[i].backface_culling = true
end
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
if worldaligntex and stair_images[i].align_style == nil then
stair_images[i].align_style = "world"
end
end