1
0
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:
crabman77 2015-07-16 15:48:55 +02:00
parent 46df48af01
commit 23545d1bc6

View File

@ -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)