Fix for gems not getting right color.

develop
Warmist 2013-06-28 17:22:24 +03:00
parent 28985167c9
commit 360b5d2e18
1 changed files with 3 additions and 2 deletions

@ -93,12 +93,13 @@ function makeMaterialDef(transparency,emitance,radius,flags)
return {tr=transparency,em=emitance,rad=radius,flags=flg} return {tr=transparency,em=emitance,rad=radius,flags=flg}
end end
function colorFrom16(col16) function colorFrom16(col16)
return copyall(df.global.enabler.ccolor[col16]) local col=df.global.enabler.ccolor[col16]
return {col[0],col[1],col[2]}
end end
function addGems() function addGems()
for k,v in pairs(df.global.world.raws.inorganics) do for k,v in pairs(df.global.world.raws.inorganics) do
if v.material.flags.IS_GEM then if v.material.flags.IS_GEM then
addMaterial("INORGANIC:"..v.id,colorFrom16(v.material.build_color[0])) addMaterial("INORGANIC:"..v.id,colorFrom16(v.material.tile_color[0]+v.material.tile_color[2]*8))
end end
end end
end end