[Fix] Fixed ai's "dead spot".
This commit is contained in:
parent
e758e541f1
commit
812321b07d
@ -55,12 +55,9 @@ function atk_g()
|
|||||||
if dist > range * atk_approach then
|
if dist > range * atk_approach then
|
||||||
atk_g_ranged(target, dist)
|
atk_g_ranged(target, dist)
|
||||||
|
|
||||||
|
-- Now we do an approach.
|
||||||
elseif dist > range * atk_aim then
|
elseif dist > range * atk_aim then
|
||||||
if ai.relvel(target) > -10 then
|
atk_g_approach(target, dist)
|
||||||
atk_g_ranged(target, dist)
|
|
||||||
else
|
|
||||||
atk_g_aim(target, dist)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Close enough to melee.
|
-- Close enough to melee.
|
||||||
else
|
else
|
||||||
@ -98,10 +95,13 @@ function atk_g_ranged(target, dist)
|
|||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
-- Aim at the target.
|
-- Approaches the target.
|
||||||
--]]
|
--]]
|
||||||
function atk_g_aim(target, dist)
|
function atk_g_approach(target, dist)
|
||||||
dir = ai.aim(target)
|
dir = ai.aim(target)
|
||||||
|
if dir < 10 then
|
||||||
|
ai.accel()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
|
Loading…
Reference in New Issue
Block a user