mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
fix crash when tools has not full_punch_interval(netherpick)
This commit is contained in:
parent
46df48af01
commit
23545d1bc6
@ -1126,7 +1126,7 @@ end
|
||||
on_punch = function(self, hitter, tflp, tool_capabilities, dir)
|
||||
-- weapon wear
|
||||
local weapon = hitter:get_wielded_item()
|
||||
if weapon:get_definition().tool_capabilities ~= nil then
|
||||
if weapon:get_definition().tool_capabilities ~= nil and weapon:get_definition().tool_capabilities.full_punch_interval ~= nil then
|
||||
local wear = ( weapon:get_definition().tool_capabilities.full_punch_interval / 75 ) * 9000
|
||||
weapon:add_wear(wear)
|
||||
hitter:set_wielded_item(weapon)
|
||||
|
Loading…
Reference in New Issue
Block a user