move static table outside of func
This commit is contained in:
parent
3ea9a9b6bf
commit
1f5800ce77
21
init.lua
21
init.lua
@ -1,6 +1,17 @@
|
||||
local COOLDOWN = 1.8
|
||||
local PARTICLE_TIME = COOLDOWN - 0.2
|
||||
|
||||
-- can't be bothered to figure out math for this
|
||||
-- map from param2 rotation to the face value
|
||||
local V = {
|
||||
1, 1, 1, 1,
|
||||
2, 3, 4, 5,
|
||||
4, 5, 2, 3,
|
||||
5, 2, 3, 4,
|
||||
3, 4, 5, 2,
|
||||
6, 6, 6, 6,
|
||||
}
|
||||
|
||||
local function roll_dice(pos, node)
|
||||
if not node then
|
||||
node = minetest.get_node(pos)
|
||||
@ -46,16 +57,6 @@ local function roll_dice(pos, node)
|
||||
}
|
||||
}
|
||||
|
||||
-- can't be bothered to figure out math for this
|
||||
local V = {
|
||||
1, 1, 1, 1,
|
||||
2, 3, 4, 5,
|
||||
4, 5, 2, 3,
|
||||
5, 2, 3, 4,
|
||||
3, 4, 5, 2,
|
||||
6, 6, 6, 6,
|
||||
}
|
||||
|
||||
minetest.add_particlespawner(spawner_def)
|
||||
|
||||
local val = V[facedir + 1] or 0
|
||||
|
Loading…
Reference in New Issue
Block a user