Various fixes
parent
cb1dbba0d4
commit
90ad60ccfa
|
@ -184,7 +184,7 @@ people.actions.go = function(state)
|
||||||
|
|
||||||
local colres = state.ent.object:get_last_collision_result()
|
local colres = state.ent.object:get_last_collision_result()
|
||||||
if colres.collides_xz then
|
if colres.collides_xz then
|
||||||
dbg.v2(state.ent.name.." collided at "..minetest.pos_to_string(state.pos))
|
dbg.v2(state.ent.name.." collided at "..minetest.pos_to_string(state.pos).." : "..dump(colres))
|
||||||
-- We've hit something...
|
-- We've hit something...
|
||||||
if distance < 32 then
|
if distance < 32 then
|
||||||
local path = minetest.find_path(state.pos, curdest,
|
local path = minetest.find_path(state.pos, curdest,
|
||||||
|
|
|
@ -264,8 +264,6 @@ subcmd.tell = {
|
||||||
params = "<name> <message>",
|
params = "<name> <message>",
|
||||||
desc = "Send a message to the given person",
|
desc = "Send a message to the given person",
|
||||||
exec = function(playername, args)
|
exec = function(playername, args)
|
||||||
if args == "help" then
|
|
||||||
end
|
|
||||||
|
|
||||||
local person, person_name
|
local person, person_name
|
||||||
person_name, person, args = get_person(args)
|
person_name, person, args = get_person(args)
|
||||||
|
@ -284,8 +282,9 @@ subcmd.tell = {
|
||||||
end
|
end
|
||||||
|
|
||||||
local sender = minetest.get_player_by_name(playername)
|
local sender = minetest.get_player_by_name(playername)
|
||||||
if not sender then return end
|
if not sender then return nil, false end
|
||||||
ent.on_tell(ent, sender, args)
|
ent.on_tell(ent, sender, args)
|
||||||
|
return nil, true
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,6 +348,7 @@ subcmd.skin = {
|
||||||
-- This gets called in the usual way, as a registered chat command handler.
|
-- This gets called in the usual way, as a registered chat command handler.
|
||||||
-- It can also get called if a person was inactive when a command was sent
|
-- It can also get called if a person was inactive when a command was sent
|
||||||
-- and was subsequently activated.
|
-- and was subsequently activated.
|
||||||
|
-- @return reply, success
|
||||||
people.do_command = function(name, param)
|
people.do_command = function(name, param)
|
||||||
|
|
||||||
local cmd, args
|
local cmd, args
|
||||||
|
|
14
footpath.lua
14
footpath.lua
|
@ -55,17 +55,19 @@ people.footpath_make_pathnodes = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for _, pn in ipairs(newpathnodes) do
|
for _, pn in pairs(newpathnodes) do
|
||||||
for _, nn in ipairs(pn.neighbours) do
|
for _, nn in pairs(pn.neighbours) do
|
||||||
local ok = false
|
local ok = false
|
||||||
for nnn in nn.neighbours do
|
for _, nnn in pairs(nn.neighbours) do
|
||||||
if nnn == pn then
|
if nnn == pn then
|
||||||
ok = true
|
ok = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not ok then
|
if not ok then
|
||||||
return "Route from "..pn.name.." at "..minetest.pos_to_string(pn.pos1).." to "..nn.name.." does not return"
|
return "Route from "..pn.name.." at "..minetest.pos_to_string(pn.pos)..
|
||||||
|
" to "..nn.name.." at "..minetest.pos_to_string(nn.pos)..
|
||||||
|
" does not return"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -226,8 +228,8 @@ people.footpath_findnext = function(curpos, lastpos, samedironly)
|
||||||
-- TODO - that means we could check it twice (but then again, only
|
-- TODO - that means we could check it twice (but then again, only
|
||||||
-- if we reach an invalid bit of footpath!
|
-- if we reach an invalid bit of footpath!
|
||||||
table.insert(xz, 1, {x=curpos.x-lastpos.x, z=curpos.z-lastpos.z})
|
table.insert(xz, 1, {x=curpos.x-lastpos.x, z=curpos.z-lastpos.z})
|
||||||
for y = 1, -1, -1 do
|
for _, cxz in ipairs(xz) do
|
||||||
for _, cxz in ipairs(xz) do
|
for y = 1, -1, -1 do
|
||||||
local x = cxz.x
|
local x = cxz.x
|
||||||
local z = cxz.z
|
local z = cxz.z
|
||||||
local npos = vector.add(curpos, vector.new(x, y, z))
|
local npos = vector.add(curpos, vector.new(x, y, z))
|
||||||
|
|
|
@ -74,7 +74,9 @@ people.people_set_active = function(entity)
|
||||||
local param = wc[2]
|
local param = wc[2]
|
||||||
dbg.v1("Re-running chat command after wake-up: "..name.." : "..param or "nil")
|
dbg.v1("Re-running chat command after wake-up: "..name.." : "..param or "nil")
|
||||||
local reply = people.do_command(name, param)
|
local reply = people.do_command(name, param)
|
||||||
minetest.chat_send_player(name, reply)
|
if reply then
|
||||||
|
minetest.chat_send_player(name, reply)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
pr.wakecmds = {}
|
pr.wakecmds = {}
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue