Merge pull request #5 from Sukender/master

Fixed running game with minetest 0.4.12
pull/6/head
Brandon 2015-06-13 16:04:53 -05:00
commit 18bb5f7d65
12 changed files with 27 additions and 17 deletions

View File

@ -215,7 +215,7 @@ local nodes_in_range = function(pos, search_distance, node_name)
end
local nodes_in_coords = function(minp, maxp, node_name)
nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
local nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
--minetest.chat_send_all("Found (" .. node_name .. ": " .. #nodes .. ")")
return #nodes
end
@ -230,7 +230,7 @@ local atleast_nodes_in_grid = function(pos, search_distance, height, node_name,
if #nodes >= threshold then
return true
end
totalnodes = #nodes
local totalnodes = #nodes
minp = {x=pos.x-search_distance,y=height, z=pos.z-20}
maxp = {x=pos.x+search_distance,y=height, z=pos.z-20}
nodes = minetest.env:find_nodes_in_area(minp, maxp, node_name)
@ -372,7 +372,7 @@ local get_ambience = function(player)
maxp = {x=pos.x+3,y=pos.y-1, z=pos.z+3}
local air_under_player = nodes_in_coords(minp, maxp, "air")
local ignore_under_player = nodes_in_coords(minp, maxp, "ignore")
air_plus_ignore_under = air_under_player + ignore_under_player
local air_plus_ignore_under = air_under_player + ignore_under_player
-- minetest.chat_send_all("airUnder:" ..air_under_player)
-- minetest.chat_send_all("ignoreUnder:" ..ignore_under_player)
-- minetest.chat_send_all("a+i:" ..air_plus_ignore_under)
@ -414,7 +414,7 @@ local get_ambience = function(player)
end
desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone"))
local desert_in_range = (nodes_in_range(pos, 6, "default:desert_sand")+nodes_in_range(pos, 6, "default:desert_stone"))
--minetest.chat_send_all("desertcount: " .. desert_in_range .. ",".. pos.y )
if desert_in_range >250 then
if music then

View File

@ -30,25 +30,29 @@ minetest.register_craftitem("default:iron_lump", {
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
groups = {skill=SKILL_COPPER},
-- groups = {skill=SKILL_COPPER},
groups = {skill=SKILL_METAL},
})
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
groups = {skill=SKILL_MESE},
-- groups = {skill=SKILL_MESE},
groups = {skill=SKILL_CRYSTAL},
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
groups = {skill=SKILL_GOLD},
-- groups = {skill=SKILL_GOLD},
groups = {skill=SKILL_METAL},
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "default_diamond.png",
groups = {skill=SKILL_DIAMOND},
-- groups = {skill=SKILL_DIAMOND},
groups = {skill=SKILL_CRYSTAL},
})
minetest.register_craftitem("default:clay_lump", {

View File

@ -8,6 +8,8 @@ WATER_VISC = 1
LAVA_VISC = 7
LIGHT_MAX = 14
intllib=minetest.get_modpath("intllib")
-- Definitions made by this mod that other mods can use too
default = {}

View File

@ -44,7 +44,7 @@ function food.support(group,mod,item)
-- Need to copy this table, not modify it in place, otherwise it can change
-- the groups for ALL craftitems that use the default groups.
g = {}
local g = {}
if data.groups then
for k, v in pairs(data.groups) do
g[k] = v

View File

@ -244,7 +244,9 @@ local function update_hud(player)
player:hud_change(stamina_hud[name],"number",s)
--magic
local m = tonumber(magic.player_magic[name])
player:hud_change(magic_hud[name],"number",m)
if m~=nil then
player:hud_change(magic_hud[name],"number",m)
end
end
hud.get_hunger = function(player)

View File

@ -46,6 +46,7 @@ local craft_ingreds = {
diamond = "default:diamond",
}
-- if minetest.global_exists(has_moreores) and has_moreores then
if has_moreores then
craft_ingreds.mithril = "moreores:mithril_ingot"
end

View File

@ -27,7 +27,7 @@ dofile(skins.modpath.."/meta.lua")
dofile(skins.modpath.."/players.lua")
skins.update_player_skin = function(player)
name = player:get_player_name()
local name = player:get_player_name()
if skins.get_type(skins.skins[name]) == skins.type.SPRITE then
player:set_properties({
visual = "upright_sprite",

View File

@ -6,7 +6,7 @@ skins.load = function()
data = input:read('*all')
end
if data and data ~= "" then
lines = string.split(data,"\n")
local lines = string.split(data,"\n")
for _, line in ipairs(lines) do
data = string.split(line, ' ', 2)
skins.skins[data[1]] = data[2]

View File

@ -36,7 +36,7 @@ money.get = function(name)
if not input then
return nil
end
credit = input:read("*n")
local credit = input:read("*n")
io.close(input)
return credit
end
@ -111,7 +111,7 @@ money.transfer = function(from, to, amount)
end
minetest.register_on_joinplayer(function(player)
name = player:get_player_name()
local name = player:get_player_name()
if not money.get(name) then
money.set(name, tostring(money.initial_amount))
end

View File

@ -63,8 +63,8 @@ end
-- node clone, for redefining stuff
function moretrees:clone_node(name)
node2={}
node=minetest.registered_nodes[name]
local node2={}
local node=minetest.registered_nodes[name]
for k,v in pairs(node) do
node2[k]=v
end

View File

@ -86,7 +86,8 @@ minetest.register_tool("throwing:bow_steel", {
sounds = {[0]="throwing_arrow_hit1",[1]="throwing_arrow_hit2"},
reload_time = 2,
damage_modifier = 5,
skill = SKILL_STEEL,
-- skill = SKILL_STEEL,
skill = SKILL_METAL,
drop_rate = -4,
})