mirror of
https://github.com/ElCeejo/animalia.git
synced 2025-03-21 15:21:22 +00:00
Fixes
This commit is contained in:
parent
325dc1609a
commit
9d6f242871
3 changed files with 22 additions and 9 deletions
|
@ -533,10 +533,8 @@ function animalia.mount(self, player, params)
|
||||||
self.rider = nil
|
self.rider = nil
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if player_api then
|
|
||||||
player_api.player_attached[player:get_player_name()] = true
|
|
||||||
end
|
|
||||||
if minetest.get_modpath("player_api") then
|
if minetest.get_modpath("player_api") then
|
||||||
|
player_api.player_attached[player:get_player_name()] = true
|
||||||
animate_player(player, "sit", 30)
|
animate_player(player, "sit", 30)
|
||||||
end
|
end
|
||||||
self.rider = player
|
self.rider = player
|
||||||
|
|
|
@ -373,6 +373,14 @@ end
|
||||||
|
|
||||||
function animalia.action_cling(self, time)
|
function animalia.action_cling(self, time)
|
||||||
local timer = time
|
local timer = time
|
||||||
|
local pos = self.object:get_pos()
|
||||||
|
if not pos then return end
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
if not creatura.get_node_def(pos).walkable then
|
||||||
|
self:forget("home_position")
|
||||||
|
self.home_position = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
local function func(_self)
|
local function func(_self)
|
||||||
_self:set_gravity(0)
|
_self:set_gravity(0)
|
||||||
_self:halt()
|
_self:halt()
|
||||||
|
@ -645,15 +653,22 @@ creatura.register_utility("animalia:fly_to_roost", function(self)
|
||||||
local home = self.home_position
|
local home = self.home_position
|
||||||
local roost = self.roost_action or creatura.action_idle
|
local roost = self.roost_action or creatura.action_idle
|
||||||
local function func(_self)
|
local function func(_self)
|
||||||
local pos = self.object:get_pos()
|
local pos = _self.object:get_pos()
|
||||||
if not pos then return end
|
if not pos then return end
|
||||||
if not home then return true end
|
if not home then return true end
|
||||||
if not _self:get_action() then
|
if not _self:get_action() then
|
||||||
if abs(pos.x - home.x) < 0.5
|
if abs(pos.x - home.x) < 0.5
|
||||||
and abs(pos.y - home.y) < 0.7
|
|
||||||
and abs(pos.z - home.z) < 0.5 then
|
and abs(pos.z - home.z) < 0.5 then
|
||||||
roost(_self, 1, "stand")
|
local y_diff = abs(pos.y - home.y)
|
||||||
return
|
if y_diff < 0.7 then
|
||||||
|
roost(_self, 1, "stand")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if y_diff <= 2
|
||||||
|
and not minetest.line_of_sight(pos, home) then
|
||||||
|
self.home_positon = nil
|
||||||
|
self:forget("home_position")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
creatura.action_move(_self, home, 3, "animalia:fly_simple", 1, "fly")
|
creatura.action_move(_self, home, 3, "animalia:fly_simple", 1, "fly")
|
||||||
end
|
end
|
||||||
|
|
|
@ -69,7 +69,7 @@ creatura.register_mob("animalia:bat", {
|
||||||
despawn_after = 2500,
|
despawn_after = 2500,
|
||||||
-- Entity Physics
|
-- Entity Physics
|
||||||
stepheight = 1.1,
|
stepheight = 1.1,
|
||||||
max_fall = 100,
|
max_fall = 0,
|
||||||
turn_rate = 12,
|
turn_rate = 12,
|
||||||
-- Visuals
|
-- Visuals
|
||||||
mesh = "animalia_bat.b3d",
|
mesh = "animalia_bat.b3d",
|
||||||
|
@ -207,7 +207,7 @@ creatura.register_mob("animalia:bat", {
|
||||||
z = rot.z
|
z = rot.z
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
if self:timer(random(3,4)) then
|
if self:timer(random(3, 4)) then
|
||||||
self:play_sound("random")
|
self:play_sound("random")
|
||||||
if guano_accumulation
|
if guano_accumulation
|
||||||
and random(16) < 2
|
and random(16) < 2
|
||||||
|
|
Loading…
Add table
Reference in a new issue