Skip to content
Snippets Groups Projects
Commit 77230ec7 authored by dg's avatar dg
Browse files

Fix crash in the shadow crypt

git-svn-id: http://svn.net-core.org/repos/t-engine4@2526 51575b47-30f0-44d4-a5cc-537603b46e54
parent e2a7e73a
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ newAI("target_simple", function(self)
-- Get list of actors ordered by distance
local arr = self.fov.actors_dist
local act
local sqsense = math.max(self.lite, self.infravision or 0, self.heightened_senses or 0)
local sqsense = math.max(self.lite or 0, self.infravision or 0, self.heightened_senses or 0)
sqsense = sqsense * sqsense
for i = 1, #arr do
act = self.fov.actors_dist[i]
......@@ -36,7 +36,7 @@ newAI("target_simple", function(self)
if act and self:reactionToward(act) < 0 and not act.dead and
(
-- If it has lite we can always see it
(act.lite > 0)
((act.lite or 0) > 0)
or
-- Otherwise check if we can see it with our "senses"
(self:canSee(act) and self.fov.actors[act].sqdist <= sqsense)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment