roles bypass

This commit is contained in:
oof2win2
2021-12-29 03:12:41 +01:00
parent 2db9e2619a
commit 2c4ff3f9e0
2 changed files with 5 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
local Event = require 'utils.event' --- @dep utils.event
local Roles = require 'expcore.roles' --- @dep expcore.roles
local filepath = "log/decon.log"
@@ -18,12 +19,14 @@ end)
Event.add(defines.events.on_player_deconstructed_area, function (e)
local player = game.get_player(e.player_index)
if Roles.has_flag(player, "deconlog-bypass") then return end
add_log(get_secs() .. player.name .. ",decon_area," .. pos_tostring(e.area.left_top) .. "," .. pos_tostring(e.area.right_bottom))
end)
Event.add(defines.events.on_built_entity, function (e)
if not e.player_index then return end
local player = game.get_player(e.player_index)
if Roles.has_flag(player, "deconlog-bypass") then return end
local ent = e.created_entity
add_log(get_secs() .. player.name .. ",built_entity," .. ent.name .. "," .. pos_tostring(ent.position) .. "," .. tostring(ent.direction) .. "," .. tostring(ent.orientation))
end)
@@ -31,6 +34,7 @@ end)
Event.add(defines.events.on_player_mined_entity, function (e)
local player = game.get_player(e.player_index)
if Roles.has_flag(player, "deconlog-bypass") then return end
local ent = e.entity
add_log(get_secs() .. player.name .. ",mined_entity," .. ent.name .. "," .. pos_tostring(ent.position) .. "," .. tostring(ent.direction) .. "," .. tostring(ent.orientation))
end)