Do not trigger exhaust for punches

Have to investigate this a bit but it fails in stamina/init.lua:81...
This commit is contained in:
SX 2021-05-29 00:33:34 +03:00 committed by GitHub
parent 42ae3f4470
commit 0c7ea53572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
local timestamp = {} local timestamp = {}
stamina.register_on_exhaust_player(function(player, change) stamina.register_on_exhaust_player(function(player, change, reason)
if type(player) ~= "userdata" or change < stamina.settings.exhaust_craft then return end if type(player) ~= "userdata" or reason == "punch" or change < stamina.settings.exhaust_craft then return end
local now = minetest.get_us_time() local now = minetest.get_us_time()
local name = player:get_player_name() local name = player:get_player_name()
if timestamp[name] then if timestamp[name] then