i hate negative numbers

This commit is contained in:
neckrat 2026-04-15 14:53:07 +03:00
parent cdf68004da
commit a16b279e44

View File

@ -75,7 +75,7 @@ local function circleVectors(center, radius)
end end
for _, v in pairs(vecs) do for _, v in pairs(vecs) do
local i = 1 local i = 1
while i <= #res and (res[i].x ~= v.x or res[i].y ~= v.y) do while i <= #res and (res[i].x ~= v.x or res[i].y ~= v.y) and v.x >= 0 and v.y >= 0 do
i = i + 1 i = i + 1
end end
if i == #res + 1 or #res == 0 then if i == #res + 1 or #res == 0 then
@ -112,7 +112,7 @@ local aiNature = {
["dev_warrior"] = function(self) ["dev_warrior"] = function(self)
return function(callback) -- почему так, описано в Task return function(callback) -- почему так, описано в Task
self.owner:try(Tree.behaviors.spellcaster, function(spellB) self.owner:try(Tree.behaviors.spellcaster, function(spellB)
self.target = pathToClosestCharacter(self.owner, 1) self.target = pathToClosestCharacter(self.owner, 2)
local task1 = spellB.spellbook[1]:cast(self.owner, self.target) local task1 = spellB.spellbook[1]:cast(self.owner, self.target)
if task1 then if task1 then
task1( task1(