ctf_map: Fix crash due to missing item description for some stairs

This commit is contained in:
ANAND 2019-10-11 16:31:19 +05:30
parent 3797c703ad
commit 96c21f2ef5
No known key found for this signature in database
GPG key ID: 3AD8A3C4A51AAB97

View file

@ -754,13 +754,17 @@ do
for name, nodedef in pairs(nodes) do for name, nodedef in pairs(nodes) do
if name:find("stairs") then if name:find("stairs") then
nodedef = table.copy(nodedef) nodedef = table.copy(nodedef)
nodedef.description = "Indestructible " .. nodedef.description if nodedef.description then
nodedef.description = "Indestructible " .. nodedef.description
end
nodedef.groups = {immortal = 1} nodedef.groups = {immortal = 1}
minetest.register_node("ctf_map:" .. name:split(":")[2], nodedef) minetest.register_node("ctf_map:" .. name:split(":")[2], nodedef)
elseif name:find("wool") then elseif name:find("wool") then
local color = name:split(":")[2] local color = name:split(":")[2]
nodedef = table.copy(nodedef) nodedef = table.copy(nodedef)
nodedef.description = "Indestructible " .. nodedef.description if nodedef.description then
nodedef.description = "Indestructible " .. nodedef.description
end
nodedef.groups = {immortal = 1} nodedef.groups = {immortal = 1}
minetest.register_node("ctf_map:wool_" .. color, nodedef) minetest.register_node("ctf_map:wool_" .. color, nodedef)
minetest.register_alias("ctf_map:" .. color, "ctf_map:wool_" .. color) minetest.register_alias("ctf_map:" .. color, "ctf_map:wool_" .. color)