🐛 fix has_flag not existing on Roles

This commit is contained in:
oof2win2
2021-12-29 16:49:49 +01:00
parent bbfde12ddd
commit 0c3b247289

View File

@@ -19,14 +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
if Roles.player_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
if Roles.player_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)
@@ -34,7 +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
if Roles.player_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)