Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

Commit

Permalink
Fix function calls on nil entities.
Browse files Browse the repository at this point in the history
  • Loading branch information
christopho committed Sep 3, 2012
1 parent 6006a18 commit f07bd3e
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/102.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/17.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/26.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/34.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/40.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/56.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/58.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/63.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/64.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion quests/zsdx/data/maps/93.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions quests/zsdx/data/maps/97.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f07bd3e

Please sign in to comment.