Added default.get_file_contents function, updated snow walkable=false

pull/2/head
Brandon 2014-07-07 21:58:06 -05:00
parent fe5336ce66
commit 39c2cfcbb4
2 changed files with 16 additions and 1 deletions

View File

@ -448,4 +448,19 @@ function default.get_distance(pos1,pos2)
else
return nil
end
end
function default.get_file_contents(filename)
local f = io.open(filename, "r")
if f==nil then
minetest.log("error","File "..filename.." not found, returning empty table")
return ""
end
local t = f:read("*all")
f:close()
if t=="" or t==nil then
minetest.log("error","File "..filename.." is blank, returning empty table")
return ""
end
return t
end

View File

@ -1137,7 +1137,7 @@ minetest.register_abm({
-- check their skills
local probability = 100
local skilled_item = false
if cooked.item:get_definition().groups["skill"] ~= nil then
if cooked.item:get_definition().groups["skill"] ~= nil and owner ~= "" then
probability = skills.get_probability(owner,SKILL_SMELTING,cooked.item:get_definition().groups["skill"])
skilled_item = true
end