forked from VoxeLibre/VoxeLibre
gotten_light being a table causing crash
I was getting a crash because gotten_light was a table, and it tried to compare with a number. This could be because of my new code, but I'm not sure.
This commit is contained in:
parent
9faa747009
commit
44c452bf25
|
@ -532,8 +532,13 @@ local function spawn_check(pos,spawn_def,ignore_caps)
|
|||
and not is_bedrock then
|
||||
--only need to poll for node light if everything else worked
|
||||
local gotten_light = get_node_light(pos)
|
||||
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
|
||||
return true
|
||||
|
||||
--gotten_light is a table sometimes, causing a crash. Don't know the cause.
|
||||
print(gotten_light)
|
||||
if type(gotten_light) ~= "table" then
|
||||
if gotten_light >= spawn_def.min_light and gotten_light <= spawn_def.max_light then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
|
|
Loading…
Reference in New Issue