5 Commits
1.0.1 ... 1.0.3

Author SHA1 Message Date
61ebaab55e Version 1.0.3 2022-02-19 23:27:55 +01:00
8a449ea8a8 Fix crash if on_punch was called w/ nil damage 2022-02-19 23:27:23 +01:00
0abcd7960a Version 1.0.2 2020-04-06 14:59:36 +02:00
f5fef5118d Fix broken mummy hit texture 2020-04-06 14:59:11 +02:00
0974de93e4 Fix occassional crash when mummy dies 2020-04-06 14:41:48 +02:00
2 changed files with 6 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# Pyramids (with Treasurer support) [`tsm_pyramids`] # Pyramids (with Treasurer support) [`tsm_pyramids`]
* Version: 1.0.1 * Version: 1.0.3
## Description ## Description
This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and This is a mod for Minetest Game which adds randomly spawned pyramids in deserts and

View File

@ -49,15 +49,11 @@ local ANIM_WALK_MINE = 5
local ANIM_MINE = 6 local ANIM_MINE = 6
local function hit(self) local function hit(self)
local prop = { self.object:set_texture_mod("^tsm_pyramids_hit.png")
mesh = mummy_mesh,
textures = {"tsm_pyramids_mummy.png^tsm_pyramids_hit.png"},
}
self.object:set_properties(prop)
minetest.after(0.4, function(self) minetest.after(0.4, function(self)
local prop = {textures = mummy_texture,} local prop = {textures = mummy_texture,}
if self ~= nil and self.object ~= nil then if self ~= nil and self.object ~= nil then
self.object:set_properties(prop) self.object:set_texture_mod("")
end end
end, self) end, self)
end end
@ -65,7 +61,6 @@ end
local function mummy_update_visuals_def(self) local function mummy_update_visuals_def(self)
npc_anim = 0 -- Animation will be set further below immediately npc_anim = 0 -- Animation will be set further below immediately
local prop = { local prop = {
mesh = mummy_mesh,
textures = mummy_texture, textures = mummy_texture,
} }
self.object:set_properties(prop) self.object:set_properties(prop)
@ -128,6 +123,7 @@ spawner_DEF.on_step = function(self, dtime)
if self.timer > 1 then if self.timer > 1 then
if n and n.name and n.name ~= "tsm_pyramids:spawner_mummy" then if n and n.name and n.name ~= "tsm_pyramids:spawner_mummy" then
self.object:remove() self.object:remove()
return
end end
end end
end end
@ -155,7 +151,7 @@ MUMMY_DEF.on_punch = function(self, puncher, time_from_last_punch, tool_capabili
end end
self.attacker = puncher self.attacker = puncher
if damage > 0 then if damage and damage > 0 then
self.last_damage = { self.last_damage = {
type = "punch", type = "punch",
puncher = puncher, puncher = puncher,
@ -244,6 +240,7 @@ MUMMY_DEF.on_step = function(self, dtime)
self.on_death(self) self.on_death(self)
end end
self.object:remove() self.object:remove()
return
else else
hit(self) hit(self)
self.sound_timer = 0 self.sound_timer = 0