1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-16 23:40:31 +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) on_punch = function(self, hitter, tflp, tool_capabilities, dir)
-- weapon wear -- weapon wear
local weapon = hitter:get_wielded_item() 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 local wear = ( weapon:get_definition().tool_capabilities.full_punch_interval / 75 ) * 9000
weapon:add_wear(wear) weapon:add_wear(wear)
hitter:set_wielded_item(weapon) hitter:set_wielded_item(weapon)