forked from VoxeLibre/VoxeLibre
change function name go_wplist -> gopath
This commit is contained in:
parent
e3bb7fe4be
commit
98231f15ae
|
@ -2919,7 +2919,7 @@ local do_states = function(self, dtime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mobs:go_wplist(self,target,callback_arrived)
|
function mobs:gopath(self,target,callback_arrived)
|
||||||
local p = self.object:get_pos()
|
local p = self.object:get_pos()
|
||||||
local t = vector.offset(target,0,1,0)
|
local t = vector.offset(target,0,1,0)
|
||||||
if not target or not p then return end
|
if not target or not p then return end
|
||||||
|
|
|
@ -575,7 +575,7 @@ local function go_home(entity)
|
||||||
entity.state = "go_home"
|
entity.state = "go_home"
|
||||||
local b=entity.bed
|
local b=entity.bed
|
||||||
if not b then return end
|
if not b then return end
|
||||||
mobs:go_wplist(entity,b,function(entity,b)
|
mobs:gopath(entity,b,function(entity,b)
|
||||||
if vector.distance(entity.object:get_pos(),b) < 2 then
|
if vector.distance(entity.object:get_pos(),b) < 2 then
|
||||||
entity.state = "stand"
|
entity.state = "stand"
|
||||||
set_velocity(entity,0)
|
set_velocity(entity,0)
|
||||||
|
@ -618,7 +618,7 @@ local function look_for_job(self)
|
||||||
if m:get_string("villager") == "" then
|
if m:get_string("villager") == "" then
|
||||||
--minetest.log("goingt to jobsite "..minetest.pos_to_string(n) )
|
--minetest.log("goingt to jobsite "..minetest.pos_to_string(n) )
|
||||||
minetest.after(0,function()
|
minetest.after(0,function()
|
||||||
mobs:go_wplist(self,n,function()
|
mobs:gopath(self,n,function()
|
||||||
--minetest.log("arrived jobsite "..minetest.pos_to_string(n) )
|
--minetest.log("arrived jobsite "..minetest.pos_to_string(n) )
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@ -1242,7 +1242,7 @@ mobs:register_mob("mobs_mc:villager", {
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
local trg=vector.new(0,9,0)
|
local trg=vector.new(0,9,0)
|
||||||
if self._jobsite then
|
if self._jobsite then
|
||||||
mobs:go_wplist(self,self._jobsite,function()
|
mobs:gopath(self,self._jobsite,function()
|
||||||
--minetest.log("arrived at jobsite")
|
--minetest.log("arrived at jobsite")
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue