Code Tidy
This commit is contained in:
parent
93dd5d6146
commit
bde00057e3
8
api.lua
8
api.lua
@ -1,4 +1,4 @@
|
|||||||
-- Mobs Api (9th September 2015)
|
-- Mobs Api (17th September 2015)
|
||||||
mobs = {}
|
mobs = {}
|
||||||
mobs.mod = "redo"
|
mobs.mod = "redo"
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ function mobs:register_mob(name, def)
|
|||||||
if v.y > 0.1 then
|
if v.y > 0.1 then
|
||||||
self.object:setacceleration({
|
self.object:setacceleration({
|
||||||
x = 0,
|
x = 0,
|
||||||
y= self.fall_speed,
|
y = self.fall_speed,
|
||||||
z = 0
|
z = 0
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@ -341,7 +341,7 @@ function mobs:register_mob(name, def)
|
|||||||
if self.jumptimer < 3 then
|
if self.jumptimer < 3 then
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
pos.y = (pos.y + self.collisionbox[2]) - 0.2
|
pos.y = (pos.y + self.collisionbox[2]) - 0.2
|
||||||
local nod = minetest.get_node(pos)
|
local nod = minetest.get_node_or_nil(pos)
|
||||||
--print ("standing on:", nod.name, pos.y)
|
--print ("standing on:", nod.name, pos.y)
|
||||||
if not nod
|
if not nod
|
||||||
or not minetest.registered_nodes[nod.name]
|
or not minetest.registered_nodes[nod.name]
|
||||||
@ -349,7 +349,7 @@ function mobs:register_mob(name, def)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.direction then
|
if self.direction then
|
||||||
pos.y = pos.y + 0.5
|
pos.y = pos.y + 0.5
|
||||||
local nod = minetest.get_node_or_nil({
|
local nod = minetest.get_node_or_nil({
|
||||||
x = pos.x + self.direction.x,
|
x = pos.x + self.direction.x,
|
||||||
y = pos.y,
|
y = pos.y,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user