From 153b519d6ba61adf0a1f6095513cf3890c0e9474 Mon Sep 17 00:00:00 2001
From: Allanis <allanis@saracraft.net>
Date: Mon, 12 Aug 2013 09:20:45 +0100
Subject: [PATCH] [Change] Compare enemy against nil.

---
 scripts/ai/collective.lua | 2 +-
 scripts/ai/empire.lua     | 2 +-
 scripts/ai/militia.lua    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/ai/collective.lua b/scripts/ai/collective.lua
index becada8..c793d06 100644
--- a/scripts/ai/collective.lua
+++ b/scripts/ai/collective.lua
@@ -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
diff --git a/scripts/ai/empire.lua b/scripts/ai/empire.lua
index 90331be..d72a8ed 100644
--- a/scripts/ai/empire.lua
+++ b/scripts/ai/empire.lua
@@ -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
diff --git a/scripts/ai/militia.lua b/scripts/ai/militia.lua
index b18274c..357ac80 100644
--- a/scripts/ai/militia.lua
+++ b/scripts/ai/militia.lua
@@ -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