diff --git a/README.txt b/README.txt index f868835..687b4f5 100644 --- a/README.txt +++ b/README.txt @@ -1,6 +1,6 @@ Minetest mod "Pyramids" ======================= -version: 0.4.1 Beta +version: 0.4.2 Beta License of source code and textures: WTFPL ------------------------------------------ diff --git a/init.lua b/init.lua index 5a8d89c..defce93 100644 --- a/init.lua +++ b/init.lua @@ -134,7 +134,7 @@ minetest.register_on_generated(function(minp, maxp, seed) if noise1 > 0.25 or noise1 < -0.26 then local mpos = {x=math.random(minp.x,maxp.x), y=math.random(minp.y,maxp.y), z=math.random(minp.z,maxp.z)} - p2 = minetest.find_node_near(mpos, 25, {"default:desert_sand"}) + local p2 = minetest.find_node_near(mpos, 25, {"default:desert_sand"}) while p2 == nil and cnt < 5 do cnt = cnt+1 mpos = {x=math.random(minp.x,maxp.x), y=math.random(minp.y,maxp.y), z=math.random(minp.z,maxp.z)} diff --git a/mummy.lua b/mummy.lua index 0c4d611..c1188e5 100644 --- a/mummy.lua +++ b/mummy.lua @@ -47,23 +47,23 @@ local ANIM_WALK_MINE = 5 local ANIM_MINE = 6 function hit(self) - prop = { + local prop = { mesh = mummy_mesh, textures = {"pyramids_mummy.png^pyramids_hit.png"}, } self.object:set_properties(prop) minetest.after(0.4, function() - prop = {textures = mummy_texture,} + local prop = {textures = mummy_texture,} self.object:set_properties(prop) end) end function mummy_update_visuals_def(self) --local name = get_player_name() - visual = default_model_def + --visual = default_model_def npc_anim = 0 -- Animation will be set further below immediately --npc_sneak[name] = false - prop = { + local prop = { mesh = mummy_mesh, textures = mummy_texture, --visual_size = {x=1, y=1, z=1}, @@ -257,8 +257,8 @@ MUMMY_DEF.on_step = function(self, dtime) for _,object in ipairs(minetest.env:get_objects_inside_radius(self.object:getpos(), 4)) do if object:is_player() then self.yawwer = false - NPC = self.object:getpos() - PLAYER = object:getpos() + local NPC = self.object:getpos() + local PLAYER = object:getpos() self.vec = {x=PLAYER.x-NPC.x, y=PLAYER.y-NPC.y, z=PLAYER.z-NPC.z} self.yaw = math.atan(self.vec.z/self.vec.x)+math.pi^2 if PLAYER.x > NPC.x then