1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-11-15 22:40:19 +01:00

format fix

This commit is contained in:
Imre Péntek 2023-06-11 20:07:41 +02:00
parent 28c4b3fb35
commit 02171c3d35

View File

@ -744,17 +744,6 @@ function default.log_player_action(player, ...)
minetest.log("action", msg)
end
local function name_and_amount(stk)
local c=stk:get_count()
if c == 0 then
return "empty"
elseif c == 1 then
return stk:get_name()
else
return stk:get_name().." "..c
end
end
local nop = function() end
function default.set_inventory_action_loggers(def, name)
local on_move = def.on_metadata_inventory_move or nop
@ -765,12 +754,12 @@ function default.set_inventory_action_loggers(def, name)
end
local on_put = def.on_metadata_inventory_put or nop
def.on_metadata_inventory_put = function(pos, listname, index, stack, player)
default.log_player_action(player, "moves", name_and_amount(stack), "to", name, "at", pos)
default.log_player_action(player, "moves", stack:get_name(), stack:get_count(), "to", name, "at", pos)
return on_put(pos, listname, index, stack, player)
end
local on_take = def.on_metadata_inventory_take or nop
def.on_metadata_inventory_take = function(pos, listname, index, stack, player)
default.log_player_action(player, "takes", name_and_amount(stack), "from", name, "at", pos)
default.log_player_action(player, "takes", stack:get_name(), stack:get_count(), "from", name, "at", pos)
return on_take(pos, listname, index, stack, player)
end
end