mirror of
https://codeberg.org/tenplus1/mobs_redo.git
synced 2024-12-25 10:10:21 +01:00
fixed flying mobs getting stuck in stairs and plants
This commit is contained in:
parent
070f02126b
commit
27fe687f8a
17
api.lua
17
api.lua
@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
-- Mobs Api (21st September 2017)
|
-- Mobs Api (4th October 2017)
|
||||||
|
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
mobs.version = "20170921"
|
mobs.version = "20171004"
|
||||||
|
|
||||||
|
|
||||||
-- Intllib
|
-- Intllib
|
||||||
@ -263,7 +263,8 @@ local flight_check = function(self, pos_w)
|
|||||||
if not def then return false end -- nil check
|
if not def then return false end -- nil check
|
||||||
|
|
||||||
if type(self.fly_in) == "string"
|
if type(self.fly_in) == "string"
|
||||||
and (nod == self.fly_in or def.liquid_alternative_flowing ~= "") then
|
and nod == self.fly_in then
|
||||||
|
-- and (nod == self.fly_in or def.liquid_alternative_flowing ~= "") then
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
@ -271,13 +272,21 @@ local flight_check = function(self, pos_w)
|
|||||||
|
|
||||||
for _,fly_in in pairs(self.fly_in) do
|
for _,fly_in in pairs(self.fly_in) do
|
||||||
|
|
||||||
if nod == fly_in or def.liquid_alternative_flowing ~= "" then
|
--if nod == fly_in or def.liquid_alternative_flowing ~= "" then
|
||||||
|
if nod == fly_in then
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- this stops mobs getting stuck inside stairs and plantlike nodes
|
||||||
|
if def.drawtype ~= "airlike"
|
||||||
|
and def.drawtype ~= "liquid"
|
||||||
|
and def.drawtype ~= "flowingliquid" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user