From 251e41bba5c27fc24cbd1143bb4cd7dd44b3eca8 Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Tue, 7 Jan 2025 18:07:38 +0900 Subject: [PATCH] . --- exp_legacy/module/modules/addons/deconlog.lua | 50 ++++--------------- 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/exp_legacy/module/modules/addons/deconlog.lua b/exp_legacy/module/modules/addons/deconlog.lua index 337a42ed..9ffc67d4 100644 --- a/exp_legacy/module/modules/addons/deconlog.lua +++ b/exp_legacy/module/modules/addons/deconlog.lua @@ -102,52 +102,20 @@ if config.fired_rocket then local ammo_inv = player.get_inventory(defines.inventory.character_ammo) --- @cast ammo_inv -nil if player.character then local item = ammo_inv[player.character.selected_gun_index] + local item_name = "" if not item or not item.valid or not item.valid_for_read then return end if item.name == "rocket" then - add_log(get_secs() .. "," .. player.name .. ",shot-rocket," .. pos_to_string(player.physical_position) .. "," .. pos_to_string(player.shooting_state.position)) + item_name = "shot-rocket" + elseif item.name == "explosive-rocket" then + item_name = "shot-explosive-rocket" + elseif item.name == "atomic-bomb" then + item_name = "shot-nuke" + end + if item.name == "rocket" then + add_log(get_secs() .. "," .. player.name .. "," .. item_name .. "," .. pos_to_string(player.physical_position) .. "," .. pos_to_string(player.shooting_state.position)) end end end) end - -if config.fired_explosive_rocket then - Event.add(defines.events.on_player_ammo_inventory_changed, function(e) - local player = game.players[e.player_index] - - if Roles.player_has_flag(player, "deconlog-bypass") then - return - end - local ammo_inv = player.get_inventory(defines.inventory.character_ammo) --- @cast ammo_inv -nil - local item = ammo_inv[player.character.selected_gun_index] - - if not item or not item.valid or not item.valid_for_read then - return - end - if item.name == "explosive-rocket" then - add_log(get_secs() .. "," .. player.name .. ",shot-explosive-rocket," .. pos_to_string(player.physical_position) .. "," .. pos_to_string(player.shooting_state.position)) - end - end) -end - -if config.fired_nuke then - Event.add(defines.events.on_player_ammo_inventory_changed, function(e) - local player = game.players[e.player_index] - - if Roles.player_has_flag(player, "deconlog-bypass") then - return - end - - local ammo_inv = player.get_inventory(defines.inventory.character_ammo) --- @cast ammo_inv -nil - local item = ammo_inv[player.character.selected_gun_index] - - if not item or not item.valid or not item.valid_for_read then - return - end - - if item.name == "atomic-bomb" then - add_log(get_secs() .. "," .. player.name .. ",shot-nuke," .. pos_to_string(player.physical_position) .. "," .. pos_to_string(player.shooting_state.position)) - end - end) -end