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

appgurueu's comments implemented

This commit is contained in:
nixnoxus 2022-04-02 11:29:44 +02:00
parent 9efd64d881
commit eb162e6c29
2 changed files with 7 additions and 10 deletions

View File

@ -1127,7 +1127,7 @@ setting `enable_non_player_action_log` is enabled.
`default.log_action(player, pos, message)`
* `player` The player who performed the action, may be `nil`
* `player` The player who performed the action
* `pos` Position of the node at which the action was performed
* `message` A message describing the action

View File

@ -758,20 +758,17 @@ function default.can_interact_with_node(player, pos)
return false
end
local non_player_action_log = minetest.settings:get_bool("enable_non_player_action_log") or false
local non_player_action_log = minetest.settings:get_bool("enable_non_player_action_log") ~= false
function default.log_action(player, pos, message)
local who = player and player:get_player_name() or "(something)"
if player and not player.is_fake_player and player:is_player() then
local who = player:get_player_name()
if not player.is_fake_player and player:is_player() then
-- log action of real player
minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos))
elseif non_player_action_log ~= false then
elseif non_player_action_log then
-- log action of non real player
if player and player.is_fake_player and type(player.is_fake_player) == "string" then
who = who .. "(" .. player.is_fake_player .. ")"
else
who = who .. "(*)"
end
who = who .. "(" .. (type(player.is_fake_player) == "string"
and player.is_fake_player or "*").. ")"
minetest.log("action", who .. " " .. message .. " at " .. minetest.pos_to_string(pos))
end
end