ajustes de compatibilidade para versao 0.4.16
parent
def894ef4c
commit
170a6ac7df
|
@ -6,7 +6,7 @@
|
|||
[![bower](https://img.shields.io/badge/bower-mod-green.svg?style=flat-square)](https://minetest-bower.herokuapp.com/mods/sociedades)
|
||||
|
||||
## Requitos
|
||||
* Minetest 0.5.0
|
||||
* Minetest 0.4.16 ou superior
|
||||
* mobs
|
||||
* default
|
||||
* vessels
|
||||
|
|
|
@ -91,7 +91,7 @@ local tb_rotat = {"0", "90", "180", "270"}
|
|||
|
||||
|
||||
-- Verificar se pode construir
|
||||
sunos.estruturas.loja.verif = function(pos, dist, verif_area)
|
||||
sunos.estruturas.loja.verif = function(pos, dist, vila, verif_area)
|
||||
|
||||
-- Validar argumentos de entrada
|
||||
if pos == nil then
|
||||
|
@ -105,7 +105,6 @@ sunos.estruturas.loja.verif = function(pos, dist, verif_area)
|
|||
|
||||
-- Variaveis auxiliares
|
||||
local largura = (dist*2)+1
|
||||
local vila
|
||||
|
||||
-- Verificar se vila existe (caso especificado)
|
||||
if vila and sunos.verificar_vila_existente(vila) == false then
|
||||
|
@ -142,11 +141,11 @@ end
|
|||
<vila> OPCIONAL | é o numero da vila a qual a estrutura decorativa pertence
|
||||
<verif_area> OPCIONAL | true verificar a area antes de montar a estrutura (retorna strings dos erros)
|
||||
]]
|
||||
sunos.estruturas.loja.construir = function(pos, dist, verif_area, force)
|
||||
sunos.estruturas.loja.construir = function(pos, dist, vila, verif_area, force)
|
||||
|
||||
-- Verifica se pode construir a casa
|
||||
if force ~= true then
|
||||
local verif, vila = sunos.estruturas.loja.verif(pos, dist, verif_area)
|
||||
local verif, vila = sunos.estruturas.loja.verif(pos, dist, vila, verif_area)
|
||||
if verif ~= true then
|
||||
return verif
|
||||
end
|
||||
|
@ -255,7 +254,7 @@ minetest.register_node("sunos:fundamento_loja", {
|
|||
|
||||
local pos = pointed_thing.under
|
||||
|
||||
local r, vila = sunos.estruturas.loja.verif(pos, 3, true)
|
||||
local r, vila = sunos.estruturas.loja.verif(pos, 3, nil, true)
|
||||
|
||||
if r == true then
|
||||
|
||||
|
|
|
@ -12,6 +12,21 @@
|
|||
-- Tradução de strings
|
||||
local S = sunos.S
|
||||
|
||||
-- Correcao para versoes antigas
|
||||
|
||||
if not minetest.registered_nodes[nodename] then
|
||||
minetest.register_alias("stairs:stair_straw", "farming:straw")
|
||||
minetest.register_alias("stairs:stair_inner_straw", "farming:straw")
|
||||
minetest.register_alias("stairs:stair_outer_straw", "farming:straw")
|
||||
minetest.register_alias("stairs:stair_wood", "default:wood")
|
||||
minetest.register_alias("stairs:stair_inner_wood", "default:wood")
|
||||
minetest.register_alias("stairs:stair_outer_wood", "default:wood")
|
||||
minetest.register_alias("stairs:stair_cobble", "default:cobble")
|
||||
minetest.register_alias("stairs:stair_inner_cobble", "default:cobble")
|
||||
minetest.register_alias("stairs:stair_outer_cobble", "default:cobble")
|
||||
end
|
||||
|
||||
-- Tabela de nodes
|
||||
local nodes_trocaveis_nodrop = {
|
||||
["default:tree"] = {name="sunos:tree_nodrop"},
|
||||
["default:glass"] = {name="sunos:glass_nodrop"},
|
||||
|
@ -37,21 +52,23 @@ local nodes_trocaveis_nodrop = {
|
|||
|
||||
-- Criar cópia sem Drop (para evitar furtos em estruturas dos sunos)
|
||||
for nodename,dados in pairs(nodes_trocaveis_nodrop) do
|
||||
|
||||
-- Copiar tabela de definições
|
||||
local def = {}
|
||||
for n,d in pairs(minetest.registered_nodes[nodename]) do
|
||||
def[n] = d
|
||||
|
||||
if minetest.registered_nodes[nodename] then
|
||||
-- Copiar tabela de definições
|
||||
local def = {}
|
||||
for n,d in pairs(minetest.registered_nodes[nodename]) do
|
||||
def[n] = d
|
||||
end
|
||||
|
||||
-- Mantem a tabela groups separada
|
||||
def.groups = minetest.deserialize(minetest.serialize(def.groups))
|
||||
|
||||
-- Altera alguns paremetros
|
||||
def.description = def.description .. " ("..S("Sem Drop")..")"
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
def.drop = ""
|
||||
|
||||
-- Registra o novo node
|
||||
minetest.register_node(dados.name, def)
|
||||
end
|
||||
|
||||
-- Mantem a tabela groups separada
|
||||
def.groups = minetest.deserialize(minetest.serialize(def.groups))
|
||||
|
||||
-- Altera alguns paremetros
|
||||
def.description = def.description .. " ("..S("Sem Drop")..")"
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
def.drop = ""
|
||||
|
||||
-- Registra o novo node
|
||||
minetest.register_node(dados.name, def)
|
||||
end
|
||||
|
|
|
@ -117,7 +117,7 @@ minetest.register_node("sunos:fundamento_step", {
|
|||
elseif tipo == "taverna" then
|
||||
r = sunos.estruturas.taverna.construir(pos, false)
|
||||
elseif tipo == "loja" then
|
||||
r = sunos.estruturas.loja.construir(pos, 3, false)
|
||||
r = sunos.estruturas.loja.construir(pos, 3, vila, false)
|
||||
else
|
||||
r = "tipo de estrutura "..dump(tipo).." nao planejado"
|
||||
end
|
||||
|
|
|
@ -646,9 +646,6 @@ sunos.criar_vila = function(pos_ref)
|
|||
|
||||
-- Variavel que verifica se ja colocou ao menos uma casa
|
||||
local tem_casa = false
|
||||
|
||||
-- Variavel que verifica se tem uma feirinha
|
||||
local tem_loja = false
|
||||
|
||||
-- Registra a nova vila
|
||||
local vila = registrar_vila(table.maxn(assent))
|
||||
|
@ -661,7 +658,7 @@ sunos.criar_vila = function(pos_ref)
|
|||
|
||||
-- Largura
|
||||
local largura = dados.dist*2+1
|
||||
|
||||
|
||||
-- Verifica se deve colocar uma feirinha
|
||||
if largura == 5 and tem_casa and tem_loja == false then tipo = "loja" end
|
||||
|
||||
|
@ -689,7 +686,7 @@ sunos.criar_vila = function(pos_ref)
|
|||
|
||||
elseif tipo == "loja" then
|
||||
|
||||
sunos.estruturas.loja.construir(dados.pos, dados.dist, vila, true)
|
||||
sunos.estruturas.loja.construir(dados.pos, dados.dist, vila, false, true)
|
||||
|
||||
tem_loja = true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue