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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 13 deletions

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