forked from mtcontrib/coloredwood
fix crash in is_stairsplus() call
(wasn't detecting grey blocks correctly)
This commit is contained in:
parent
2f110809d1
commit
efd0286fe3
14
init.lua
14
init.lua
|
@ -134,11 +134,15 @@ local function is_stairsplus(name)
|
||||||
|
|
||||||
local h, s, v = unifieddyes.get_hsv(name)
|
local h, s, v = unifieddyes.get_hsv(name)
|
||||||
|
|
||||||
a,b = string.find(name, "_"..h..s)
|
a,b = string.find(name, "wood")
|
||||||
if a then s2 = string.sub(name, b+1)
|
if b then
|
||||||
if string.find(s2, "wood") then s2 = string.sub(s2, 5) end
|
s2 = string.sub(name, b+1)
|
||||||
|
local a,b = string.find(name, "grey")
|
||||||
|
if not a then
|
||||||
|
a,b = string.find(name, "_"..h..s)
|
||||||
|
end
|
||||||
|
return s1, string.sub(s2, 5)
|
||||||
end
|
end
|
||||||
return s1, s2
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- the actual nodes!
|
-- the actual nodes!
|
||||||
|
@ -313,6 +317,8 @@ minetest.register_lbm({
|
||||||
|
|
||||||
if s1 then
|
if s1 then
|
||||||
|
|
||||||
|
if not s2 then print("impossible conversion request! name = "..node.name.." --> ".."coloredwood:"..s1.."_wood_"..hue.."*nil*") return end
|
||||||
|
|
||||||
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, true)
|
local paletteidx, _ = unifieddyes.getpaletteidx("unifieddyes:"..color, true)
|
||||||
local cfdir = paletteidx + (node.param2 % 32)
|
local cfdir = paletteidx + (node.param2 % 32)
|
||||||
local newname = "coloredwood:"..s1.."_wood_"..hue..s2
|
local newname = "coloredwood:"..s1.."_wood_"..hue..s2
|
||||||
|
|
Loading…
Reference in New Issue