mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-02 00:10:21 +02:00
added custom after_activate function check
This commit is contained in:
11
api.lua
11
api.lua
@ -2099,9 +2099,9 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||
end
|
||||
|
||||
-- mob health check
|
||||
if self.health <= 0 then
|
||||
return
|
||||
end
|
||||
-- if self.health <= 0 then
|
||||
-- return
|
||||
-- end
|
||||
|
||||
-- error checking when mod profiling is enabled
|
||||
if not tool_capabilities then
|
||||
@ -2507,6 +2507,11 @@ local mob_activate = function(self, staticdata, def, dtime)
|
||||
end
|
||||
end
|
||||
|
||||
-- run after_activate
|
||||
if def.after_activate then
|
||||
def.after_activate(self, staticdata, def, dtime)
|
||||
end
|
||||
|
||||
if use_cmi then
|
||||
self._cmi_components = cmi.activate_components(self.serialized_cmi_components)
|
||||
cmi.notify_activate(self.object, dtime)
|
||||
|
Reference in New Issue
Block a user