mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 12:31:05 +01:00
Unhardcoded nil
This commit is contained in:
parent
23468cc2dd
commit
b320d008ca
1 changed files with 1 additions and 2 deletions
|
@ -19,14 +19,13 @@ end
|
||||||
---@return boolean If the ladder and trapdoor are in the same direction.
|
---@return boolean If the ladder and trapdoor are in the same direction.
|
||||||
function mcl_core.check_direction(ladder, trapdoor)
|
function mcl_core.check_direction(ladder, trapdoor)
|
||||||
local convert_table = {
|
local convert_table = {
|
||||||
nil,
|
|
||||||
{ 1, 23 },
|
{ 1, 23 },
|
||||||
{ 3, 21 },
|
{ 3, 21 },
|
||||||
{ 0, 20 },
|
{ 0, 20 },
|
||||||
{ 2, 22 },
|
{ 2, 22 },
|
||||||
}
|
}
|
||||||
|
|
||||||
local conversion = convert_table[ladder];
|
local conversion = convert_table[ladder - 1];
|
||||||
if not conversion then
|
if not conversion then
|
||||||
return false
|
return false
|
||||||
elseif conversion[1] == trapdoor or conversion[2] == trapdoor then
|
elseif conversion[1] == trapdoor or conversion[2] == trapdoor then
|
||||||
|
|
Loading…
Reference in a new issue