mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Put in check to prevent Trying to Reference a Nil error in Apply_Modifier.
This commit is contained in:
parent
4f3f59f4bc
commit
2f8389d3f5
1 changed files with 7 additions and 3 deletions
|
@ -74,9 +74,11 @@ function mcl_fovapi.apply_modifier(player, modifier_name)
|
||||||
if mcl_fovapi.registered_modifiers[modifier_name] == nil then
|
if mcl_fovapi.registered_modifiers[modifier_name] == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if mcl_fovapi.applied_modifiers ~= nil and mcl_fovapi.applied_modifiers[player] ~= nil and mcl_fovapi.applied_modifiers[player][modifier_name] ~= nil then
|
||||||
if mcl_fovapi.applied_modifiers[player][modifier_name] and mcl_fovapi.applied_modifiers[player][modifier_name] == true then
|
if mcl_fovapi.applied_modifiers[player][modifier_name] and mcl_fovapi.applied_modifiers[player][modifier_name] == true then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local modifier = mcl_fovapi.registered_modifiers[modifier_name]
|
local modifier = mcl_fovapi.registered_modifiers[modifier_name]
|
||||||
if modifier.on_start ~= nil then
|
if modifier.on_start ~= nil then
|
||||||
|
@ -113,7 +115,9 @@ function mcl_fovapi.remove_modifier(player, modifier_name)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if mcl_fovapi.applied_modifiers[player][modifier_name] == nil then return end
|
if mcl_fovapi.applied_modifiers[player][modifier_name] == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if DEBUG then
|
if DEBUG then
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
|
Loading…
Reference in a new issue