fix wrong local non local variable for function scope only

* backported from 15a6083540
This commit is contained in:
mckaygerhard 2023-06-05 10:11:10 -04:00
parent da5228f37f
commit bbe37a1d9c

View File

@ -19,7 +19,7 @@ minetest.register_entity("mobs_doomed:butterfly", {
textures = {"dmobs_butterfly.png",},
visual_size = {x=0.3, y=0.3},
on_activate = function(self)
num = math.random(1,4)
local num = math.random(1,4)
self.object:set_properties({textures = {"dmobs_butterfly"..num..".png",},})
self.object:set_animation({x=1, y=10}, 20, 0)
self.object:set_yaw(math.pi+num)