[Change] Compare enemy against nil.

This commit is contained in:
Allanis 2013-08-12 09:20:45 +01:00
parent 9532e9fdf0
commit 153b519d6b
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ include("../scripts/ai/include/basic.lua")
control_rate = 2
function control()
if ai.taskname() == "none" then
if ai.taskname() == nil then
enemy = ai.getenemy()
if enemey ~= 0 then

View File

@ -8,7 +8,7 @@ function control()
task = ai.taskname()
enemy = ai.getenemy()
if task ~= "attack" and enemy ~= 0 then
if task ~= "attack" and enemy ~= nil then
ai.hostile(enemy)
ai.pushtask(0, "attack", enemy)
elseif task == "none" then

View File

@ -8,7 +8,7 @@ function control()
task = ai.taskname()
enemy = ai.getenemy()
if task ~= "attack" and enemy ~= 0 then
if task ~= "attack" and enemy ~= nil then
ai.hostile(enemy)
ai.pushtask(0, "attack", enemy)
elseif ai.taskname() == "none" then