Various fixes

master
Ciaran Gultnieks 2014-04-16 22:38:05 +01:00
parent cb1dbba0d4
commit 90ad60ccfa
4 changed files with 15 additions and 11 deletions

View File

@ -184,7 +184,7 @@ people.actions.go = function(state)
local colres = state.ent.object:get_last_collision_result()
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...
if distance < 32 then
local path = minetest.find_path(state.pos, curdest,

View File

@ -264,8 +264,6 @@ subcmd.tell = {
params = "<name> <message>",
desc = "Send a message to the given person",
exec = function(playername, args)
if args == "help" then
end
local person, person_name
person_name, person, args = get_person(args)
@ -284,8 +282,9 @@ subcmd.tell = {
end
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)
return nil, true
end
}
@ -349,6 +348,7 @@ subcmd.skin = {
-- 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
-- and was subsequently activated.
-- @return reply, success
people.do_command = function(name, param)
local cmd, args

View File

@ -55,17 +55,19 @@ people.footpath_make_pathnodes = function()
end
end
for _, pn in ipairs(newpathnodes) do
for _, nn in ipairs(pn.neighbours) do
for _, pn in pairs(newpathnodes) do
for _, nn in pairs(pn.neighbours) do
local ok = false
for nnn in nn.neighbours do
for _, nnn in pairs(nn.neighbours) do
if nnn == pn then
ok = true
break
end
end
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
@ -226,8 +228,8 @@ people.footpath_findnext = function(curpos, lastpos, samedironly)
-- TODO - that means we could check it twice (but then again, only
-- if we reach an invalid bit of footpath!
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 z = cxz.z
local npos = vector.add(curpos, vector.new(x, y, z))

View File

@ -74,7 +74,9 @@ people.people_set_active = function(entity)
local param = wc[2]
dbg.v1("Re-running chat command after wake-up: "..name.." : "..param or "nil")
local reply = people.do_command(name, param)
minetest.chat_send_player(name, reply)
if reply then
minetest.chat_send_player(name, reply)
end
end
pr.wakecmds = {}
end)