forked from mtcontrib/mobs_redo
disable random up.down movement for flying/swimming mobs (for now)
This commit is contained in:
parent
0849727ee9
commit
5889886f3c
11
api.lua
11
api.lua
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20180406"
|
mobs.version = "20180408"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -750,9 +750,9 @@ local do_jump = function(self)
|
|||||||
|
|
||||||
self.object:setvelocity(v)
|
self.object:setvelocity(v)
|
||||||
|
|
||||||
if get_velocity(self) > 0 then
|
if get_velocity(self) > 0 then
|
||||||
mob_sound(self, self.sounds.jump)
|
mob_sound(self, self.sounds.jump)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.facing_fence = true
|
self.facing_fence = true
|
||||||
end
|
end
|
||||||
@ -1666,14 +1666,14 @@ local do_states = function(self, dtime)
|
|||||||
self.state = "walk"
|
self.state = "walk"
|
||||||
set_animation(self, "walk")
|
set_animation(self, "walk")
|
||||||
|
|
||||||
-- fly up/down randomly for flying mobs
|
--[[ fly up/down randomly for flying mobs
|
||||||
if self.fly and random(1, 100) <= self.walk_chance then
|
if self.fly and random(1, 100) <= self.walk_chance then
|
||||||
|
|
||||||
local v = self.object:getvelocity()
|
local v = self.object:getvelocity()
|
||||||
local ud = random(-1, 2) / 9
|
local ud = random(-1, 2) / 9
|
||||||
|
|
||||||
self.object:setvelocity({x = v.x, y = ud, z = v.z})
|
self.object:setvelocity({x = v.x, y = ud, z = v.z})
|
||||||
end
|
end--]]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -2194,7 +2194,6 @@ local falling = function(self, pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- in water then float up
|
-- in water then float up
|
||||||
-- if minetest.registered_nodes[node_ok(pos).name].groups.liquid then
|
|
||||||
if minetest.registered_nodes[node_ok(pos).name].groups.water then
|
if minetest.registered_nodes[node_ok(pos).name].groups.water then
|
||||||
|
|
||||||
if self.floats == 1 then
|
if self.floats == 1 then
|
||||||
|
Loading…
Reference in New Issue
Block a user