Fix variable == nil.
This commit is contained in:
parent
b6e66def05
commit
410259de35
1 changed files with 5 additions and 3 deletions
8
mobs.lua
8
mobs.lua
|
@ -156,9 +156,11 @@ for _, mob in pairs(mob_stats) do
|
||||||
end
|
end
|
||||||
|
|
||||||
local function fun_caves_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
local function fun_caves_punch(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||||
local player_name = puncher:get_player_name()
|
if puncher and puncher.get_player_name then
|
||||||
if fun_caves.db.status[player_name].damage_elixir then
|
local player_name = puncher:get_player_name()
|
||||||
tool_capabilities.damage_groups.fleshy = tool_capabilities.damage_groups.fleshy + fun_caves.db.status[player_name].damage_elixir.bonus
|
if player_name and fun_caves.db.status[player_name].damage_elixir and tool_capabilities and tool_capabilities.damage_groups and tool_capabilities.damage_groups.fleshy then
|
||||||
|
tool_capabilities.damage_groups.fleshy = tool_capabilities.damage_groups.fleshy + fun_caves.db.status[player_name].damage_elixir.bonus
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.on_punch_orig(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
self.on_punch_orig(self, puncher, time_from_last_punch, tool_capabilities, dir)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue