Skip to content
Browse files

Fix function calls on nil entities.

  • Loading branch information...
1 parent 6006a18 commit f07bd3e30b6b89391e2a3e9f01115b26fce77244 @christopho committed Sep 3, 2012
View
2 quests/zsdx/data/maps/102.lua
@@ -8,7 +8,7 @@ local code_next_index = 1
-- Returns whether all torches are on
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/17.lua
@@ -3,7 +3,7 @@ local map = ...
local function are_all_torches_on()
- return torch1:exists()
+ return torch1 ~= nil
and torch1:get_sprite():get_animation() == "lit"
and torch2:get_sprite():get_animation() == "lit"
and torch3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/26.lua
@@ -22,7 +22,7 @@ end
-- Returns whether all four torches are on
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/34.lua
@@ -3,7 +3,7 @@ local map = ...
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/40.lua
@@ -7,7 +7,7 @@ local remove_water_delay = 500 -- delay between each step when some water is di
-- Returns whether all five torches are on
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/56.lua
@@ -5,7 +5,7 @@ local fighting_miniboss = false
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
end
View
2 quests/zsdx/data/maps/58.lua
@@ -3,7 +3,7 @@ local map = ...
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
end
View
2 quests/zsdx/data/maps/63.lua
@@ -19,7 +19,7 @@ end
-- Returns whether all torches are on
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/64.lua
@@ -6,7 +6,7 @@ sol.main.load_file("maps/prison_guard")(map)
-- Returns whether all torches are on
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
2 quests/zsdx/data/maps/93.lua
@@ -21,7 +21,7 @@ end
local function are_all_torches_on()
- return torch_1:exists()
+ return torch_1 ~= nil
and torch_1:get_sprite():get_animation() == "lit"
and torch_2:get_sprite():get_animation() == "lit"
and torch_3:get_sprite():get_animation() == "lit"
View
4 quests/zsdx/data/maps/97.lua
@@ -3,15 +3,15 @@ local map = ...
local function are_group1_torches_on()
- return torch1_1:exists()
+ return torch1_1 ~= nil
and torch1_1:get_sprite():get_animation() == "lit"
and torch1_2:get_sprite():get_animation() == "lit"
and torch1_3:get_sprite():get_animation() == "lit"
end
local function are_group2_torches_on()
- return torch2_1:exists()
+ return torch2_1 ~= nil
and torch2_1:get_sprite():get_animation() == "lit"
and torch2_2:get_sprite():get_animation() == "lit"
and torch2_3:get_sprite():get_animation() == "lit"

0 comments on commit f07bd3e

Please sign in to comment.
Something went wrong with that request. Please try again.