Get rid of a ton of global variables

This commit is contained in:
Wuzzy 2017-01-24 02:31:49 +01:00
parent 06933135b4
commit bc9491ffdd
22 changed files with 214 additions and 4114 deletions

View file

@ -1,5 +1,3 @@
LIGHT_MAX = 15
minetest.register_craftitem("farming:pumpkin_seed", {
description = "Pumpkin Seed",
stack_max = 64,
@ -69,7 +67,7 @@ minetest.register_node("farming:pumpkin_face", {
end
if have_change == 0 then
for z=-1,1 do
p = {x=pos.x, y=pos.y, z=pos.z+z}
local p = {x=pos.x, y=pos.y, z=pos.z+z}
local n = minetest.get_node(p)
if string.find(n.name, "pumpkintige_linked_") and have_change == 0 then
have_change = 1
@ -245,9 +243,9 @@ minetest.register_abm({
end
if have_change == 0 then
for z=-1,1 do
p = {x=pos.x, y=pos.y-1, z=pos.z+z}
local p = {x=pos.x, y=pos.y-1, z=pos.z+z}
newpos = {x=pos.x, y=pos.y, z=pos.z+z}
n = minetest.get_node(p)
local n = minetest.get_node(p)
local nod2 = minetest.get_node(newpos)
if n.name=="default:dirt_with_grass" and nod2.name=="air" and have_change == 0
or n.name=="default:dirt" and nod2.name=="air" and have_change == 0