Fix spike error.

This commit is contained in:
Duane Robertson 2016-05-29 06:20:20 -05:00
parent 558e778861
commit 16983356c8
3 changed files with 27 additions and 38 deletions

View file

@ -208,20 +208,15 @@ minetest.register_abm({
minetest.register_abm({
nodenames = fun_caves.hot_spikes,
interval = 30 * fun_caves.time_factor,
chance = 10,
chance = 30,
action = function(pos, node)
local spike_num
for i = 1, #hot_spikes do
if hot_spikes[i] == node.name then
spike_num = i
end
end
local spike_num = fun_caves.hot_spike[node.name]
if not spike_num then
return
end
if spike_num < #hot_spikes then
set_node(pos, {name=hot_spikes[spike_num+1]})
if spike_num < #fun_caves.hot_spikes then
set_node(pos, {name=fun_caves.hot_spikes[spike_num+1]})
return
end