From 03a7de0b2d3570d54d30e2f760882f09fd85e4e6 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 20 Aug 2019 06:24:57 +0200 Subject: [PATCH] Clean up variable handling in minetest.after --- mummy.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mummy.lua b/mummy.lua index 4be35f4..b7e0977 100644 --- a/mummy.lua +++ b/mummy.lua @@ -52,10 +52,12 @@ local function hit(self) textures = {"tsm_pyramids_mummy.png^tsm_pyramids_hit.png"}, } self.object:set_properties(prop) - minetest.after(0.4, function() - local prop = {textures = mummy_texture,} - self.object:set_properties(prop) - end) + minetest.after(0.4, function(self) + local prop = {textures = mummy_texture,} + if self.object ~= nil then + self.object:set_properties(prop) + end + end, self) end local function mummy_update_visuals_def(self) -- 2.11.4.GIT