forked from Sokomine/yl_speak_up
re-added yl_speak_up.on_spawn to mobs.lua for now
This commit is contained in:
parent
2a1f194e19
commit
ae407e1615
20
mobs.lua
20
mobs.lua
@ -1,3 +1,23 @@
|
||||
-- assing ID at spawning (not at first talk) and log it
|
||||
function yl_speak_up.on_spawn(self)
|
||||
--Let's protect it
|
||||
self.protected = true
|
||||
self.tamed = true
|
||||
self.object:set_armor_groups({immortal = 100})
|
||||
|
||||
--Let's assign an ID (usually this happens at first talk)
|
||||
self = yl_speak_up.initialize_npc(self)
|
||||
|
||||
if(not(self) or not(self.yl_speak_up) or not(self.yl_speak_up.id)) then
|
||||
-- something went very wrong
|
||||
return false
|
||||
end
|
||||
yl_speak_up.log_change("-", "n_"..self.yl_speak_up.id,
|
||||
"spawned at "..minetest.pos_to_string(self.object:get_pos()), "action")
|
||||
--Let's do it only once
|
||||
return true
|
||||
end
|
||||
|
||||
mobs:register_mob("yl_speak_up:human", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user