[Change] Compare enemy against nil.
This commit is contained in:
parent
9532e9fdf0
commit
153b519d6b
@ -4,7 +4,7 @@ include("../scripts/ai/include/basic.lua")
|
|||||||
control_rate = 2
|
control_rate = 2
|
||||||
|
|
||||||
function control()
|
function control()
|
||||||
if ai.taskname() == "none" then
|
if ai.taskname() == nil then
|
||||||
enemy = ai.getenemy()
|
enemy = ai.getenemy()
|
||||||
|
|
||||||
if enemey ~= 0 then
|
if enemey ~= 0 then
|
||||||
|
@ -8,7 +8,7 @@ function control()
|
|||||||
task = ai.taskname()
|
task = ai.taskname()
|
||||||
|
|
||||||
enemy = ai.getenemy()
|
enemy = ai.getenemy()
|
||||||
if task ~= "attack" and enemy ~= 0 then
|
if task ~= "attack" and enemy ~= nil then
|
||||||
ai.hostile(enemy)
|
ai.hostile(enemy)
|
||||||
ai.pushtask(0, "attack", enemy)
|
ai.pushtask(0, "attack", enemy)
|
||||||
elseif task == "none" then
|
elseif task == "none" then
|
||||||
|
@ -8,7 +8,7 @@ function control()
|
|||||||
task = ai.taskname()
|
task = ai.taskname()
|
||||||
|
|
||||||
enemy = ai.getenemy()
|
enemy = ai.getenemy()
|
||||||
if task ~= "attack" and enemy ~= 0 then
|
if task ~= "attack" and enemy ~= nil then
|
||||||
ai.hostile(enemy)
|
ai.hostile(enemy)
|
||||||
ai.pushtask(0, "attack", enemy)
|
ai.pushtask(0, "attack", enemy)
|
||||||
elseif ai.taskname() == "none" then
|
elseif ai.taskname() == "none" then
|
||||||
|
Loading…
Reference in New Issue
Block a user