Skip to content
Snippets Groups Projects
Commit 34ccfada authored by dg's avatar dg
Browse files

fix an obscure bug

git-svn-id: http://svn.net-core.org/repos/t-engine4@3576 51575b47-30f0-44d4-a5cc-537603b46e54
parent 0cae1cb5
No related branches found
No related tags found
No related merge requests found
......@@ -94,9 +94,7 @@ function _M:moveDirection(x, y)
-- if we are blocked, try some other way
if not self:aiCanPass(lx, ly) then
local dirx = lx - self.x
local diry = ly - self.y
local dir = coord_to_dir[dirx][diry]
local dir = util.getDir(lx, ly, self.x, self.y)
local list = coords[dir]
local l = {}
......
......@@ -89,11 +89,10 @@ end
local function more_aid(npc, player)
return not (q:isCompleted(e[1].full) and q:isCompleted(e[2].full) and q:isCompleted(e[3].full)) --make sure all the elixirs aren't already made
--Next, for each of the three elixirs, make sure it's not the case that:
--1) we're either working on it or... 2) we've started (but not finished) the elixir and it got poached.
and not ((q:isCompleted(e[1].start) and not q:isCompleted(e[1].full)) or (q:isCompleted(e[1].start) and q:isCompleted(e[1].poached) and q:isCompleted(e[1].almost)) )
and not ((q:isCompleted(e[2].start) and not q:isCompleted(e[2].full)) or (q:isCompleted(e[2].start) and q:isCompleted(e[2].poached) and q:isCompleted(e[2].almost)) )
and not ((q:isCompleted(e[3].start) and not q:isCompleted(e[3].full)) or (q:isCompleted(e[3].start) and q:isCompleted(e[3].poached) and q:isCompleted(e[3].almost)) )
--Next, for each of the three elixirs, make sure it's not the case that we're still working on it
and not (q:isCompleted(e[1].start) and not q:isCompleted(e[1].full))
and not (q:isCompleted(e[2].start) and not q:isCompleted(e[2].full))
and not (q:isCompleted(e[3].start) and not q:isCompleted(e[3].full))
end
local function give_bits(npc, player, n) -- n is the index of the elixir we're checking on
......
......@@ -89,11 +89,10 @@ end
local function more_aid(npc, player)
return not (q:isCompleted(e[1].full) and q:isCompleted(e[2].full) and q:isCompleted(e[3].full)) --make sure all the elixirs aren't already made
--Next, for each of the three elixirs, make sure it's not the case that:
--1) we're either working on it or... 2) we've started (but not finished) the elixir and it got poached.
and not ((q:isCompleted(e[1].start) and not q:isCompleted(e[1].full)) or (q:isCompleted(e[1].start) and q:isCompleted(e[1].poached) and q:isCompleted(e[1].almost)) )
and not ((q:isCompleted(e[2].start) and not q:isCompleted(e[2].full)) or (q:isCompleted(e[2].start) and q:isCompleted(e[2].poached) and q:isCompleted(e[2].almost)) )
and not ((q:isCompleted(e[3].start) and not q:isCompleted(e[3].full)) or (q:isCompleted(e[3].start) and q:isCompleted(e[3].poached) and q:isCompleted(e[3].almost)) )
--Next, for each of the three elixirs, make sure it's not the case that we're still working on it
and not (q:isCompleted(e[1].start) and not q:isCompleted(e[1].full))
and not (q:isCompleted(e[2].start) and not q:isCompleted(e[2].full))
and not (q:isCompleted(e[3].start) and not q:isCompleted(e[3].full))
end
local function give_bits(npc, player, n) -- n is the index of the elixir we're checking on
......
......@@ -92,11 +92,10 @@ end
local function more_aid(npc, player)
return not (q:isCompleted(e[1].full) and q:isCompleted(e[2].full) and q:isCompleted(e[3].full)) --make sure all the elixirs aren't already made
--Next, for each of the three elixirs, make sure it's not the case that:
--1) we're either working on it or... 2) we've started (but not finished) the elixir and it got poached.
and not ((q:isCompleted(e[1].start) and not q:isCompleted(e[1].full)) or (q:isCompleted(e[1].start) and q:isCompleted(e[1].poached) and q:isCompleted(e[1].almost)) )
and not ((q:isCompleted(e[2].start) and not q:isCompleted(e[2].full)) or (q:isCompleted(e[2].start) and q:isCompleted(e[2].poached) and q:isCompleted(e[2].almost)) )
and not ((q:isCompleted(e[3].start) and not q:isCompleted(e[3].full)) or (q:isCompleted(e[3].start) and q:isCompleted(e[3].poached) and q:isCompleted(e[3].almost)) )
--Next, for each of the three elixirs, make sure it's not the case that we're still working on it
and not (q:isCompleted(e[1].start) and not q:isCompleted(e[1].full))
and not (q:isCompleted(e[2].start) and not q:isCompleted(e[2].full))
and not (q:isCompleted(e[3].start) and not q:isCompleted(e[3].full))
end
local function give_bits(npc, player, n) -- n is the index of the elixir we're checking on
......
......@@ -89,11 +89,10 @@ end
local function more_aid(npc, player)
return not (q:isCompleted(e[1].full) and q:isCompleted(e[2].full) and q:isCompleted(e[3].full)) --make sure all the elixirs aren't already made
--Next, for each of the three elixirs, make sure it's not the case that:
--1) we're either working on it or... 2) we've started (but not finished) the elixir and it got poached.
and not ((q:isCompleted(e[1].start) and not q:isCompleted(e[1].full)) or (q:isCompleted(e[1].start) and q:isCompleted(e[1].poached) and q:isCompleted(e[1].almost)) )
and not ((q:isCompleted(e[2].start) and not q:isCompleted(e[2].full)) or (q:isCompleted(e[2].start) and q:isCompleted(e[2].poached) and q:isCompleted(e[2].almost)) )
and not ((q:isCompleted(e[3].start) and not q:isCompleted(e[3].full)) or (q:isCompleted(e[3].start) and q:isCompleted(e[3].poached) and q:isCompleted(e[3].almost)) )
--Next, for each of the three elixirs, make sure it's not the case that we're still working on it
and not (q:isCompleted(e[1].start) and not q:isCompleted(e[1].full))
and not (q:isCompleted(e[2].start) and not q:isCompleted(e[2].full))
and not (q:isCompleted(e[3].start) and not q:isCompleted(e[3].full))
end
local function give_bits(npc, player, n) -- n is the index of the elixir we're checking on
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment