Fix gates drop bug reported by kaeza and Kacey, avoid polluting the global namespace.

This commit is contained in:
Anthony Zhang 2013-01-06 14:09:54 -05:00
parent ec07fc27d7
commit 17579a6aa1

View File

@ -98,6 +98,7 @@ gates = {
{name = "and" , inputnumber = 2}, {name = "and" , inputnumber = 2},
{name = "xor" , inputnumber = 2}} {name = "xor" , inputnumber = 2}}
local onoff, drop, nodename, description, groups
for i, gate in ipairs(gates) do for i, gate in ipairs(gates) do
if gate.inputnumber == 1 then if gate.inputnumber == 1 then
get_rules = gate_get_input_rules_oneinput get_rules = gate_get_input_rules_oneinput
@ -114,6 +115,7 @@ for i, gate in ipairs(gates) do
groups = {dig_immediate=2, not_in_creative_inventory=1} groups = {dig_immediate=2, not_in_creative_inventory=1}
else else
onoff = "off" onoff = "off"
drop = nil
nodename = nodename.."_"..onoff nodename = nodename.."_"..onoff
description = gate.name.." Gate" description = gate.name.." Gate"
groups = {dig_immediate=2} groups = {dig_immediate=2}