mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2025-07-18 00:00:23 +02:00
Compare commits
2 Commits
76ee3d0b51
...
622abd1486
Author | SHA1 | Date | |
---|---|---|---|
622abd1486 | |||
55eb893a9a |
11
api.lua
11
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210104",
|
version = "20210108",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -572,7 +572,8 @@ function mob_class:attempt_flight_correction(override)
|
|||||||
|
|
||||||
local flyable_nodes = minetest.find_nodes_in_area(
|
local flyable_nodes = minetest.find_nodes_in_area(
|
||||||
{x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
{x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
||||||
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}, searchnodes)
|
{x = pos.x + 1, y = pos.y + 0, z = pos.z + 1}, searchnodes)
|
||||||
|
-- pos.y + 0 hopefully fixes floating swimmers
|
||||||
|
|
||||||
if #flyable_nodes < 1 then
|
if #flyable_nodes < 1 then
|
||||||
return false
|
return false
|
||||||
@ -909,6 +910,7 @@ function mob_class:check_for_death(cmi_cause)
|
|||||||
local rot = self.animation.die_rotate and 5
|
local rot = self.animation.die_rotate and 5
|
||||||
|
|
||||||
self.attack = nil
|
self.attack = nil
|
||||||
|
self.following = nil
|
||||||
self.v_start = false
|
self.v_start = false
|
||||||
self.timer = 0
|
self.timer = 0
|
||||||
self.blinktimer = 0
|
self.blinktimer = 0
|
||||||
@ -916,7 +918,7 @@ function mob_class:check_for_death(cmi_cause)
|
|||||||
self.state = "die"
|
self.state = "die"
|
||||||
self.object:set_properties({
|
self.object:set_properties({
|
||||||
pointable = false, collide_with_objects = false,
|
pointable = false, collide_with_objects = false,
|
||||||
automatic_rotate = rot,
|
automatic_rotate = rot, static_save = false
|
||||||
})
|
})
|
||||||
self:set_velocity(0)
|
self:set_velocity(0)
|
||||||
self:set_animation("die")
|
self:set_animation("die")
|
||||||
@ -3073,6 +3075,7 @@ function mob_class:mob_staticdata()
|
|||||||
if t ~= "function"
|
if t ~= "function"
|
||||||
and t ~= "nil"
|
and t ~= "nil"
|
||||||
and t ~= "userdata"
|
and t ~= "userdata"
|
||||||
|
and _ ~= "object"
|
||||||
and _ ~= "_cmi_components" then
|
and _ ~= "_cmi_components" then
|
||||||
tmp[_] = self[_]
|
tmp[_] = self[_]
|
||||||
end
|
end
|
||||||
@ -3325,6 +3328,8 @@ function mob_class:on_step(dtime, moveresult)
|
|||||||
}}
|
}}
|
||||||
}]]
|
}]]
|
||||||
|
|
||||||
|
if self.state == "die" then return end ----------------
|
||||||
|
|
||||||
if use_cmi then
|
if use_cmi then
|
||||||
cmi.notify_step(self.object, dtime)
|
cmi.notify_step(self.object, dtime)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user