From 57771d94b799329a7d3ede156066bfaa79fa3e9a Mon Sep 17 00:00:00 2001 From: VladMordock Date: Fri, 15 Mar 2019 10:26:31 +0100 Subject: [PATCH] Update Perun.lua Fix for friendly fire not being properly logged --- 01_DCS/Hooks/Perun.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/01_DCS/Hooks/Perun.lua b/01_DCS/Hooks/Perun.lua index d5ed9a4..18f89ee 100644 --- a/01_DCS/Hooks/Perun.lua +++ b/01_DCS/Hooks/Perun.lua @@ -497,7 +497,7 @@ Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7) Perun.LogEvent(eventName,Perun.SideID2Name( net.get_player_info(arg1, "side")) .. " player " .. net.get_player_info(arg1, "name").." killed friendy " .. net.get_player_info(arg3, "name") .. " using " .. arg2,nil,nil); if arg1 ~= arg3 then - Perun.LogStatsCount(arg1,"friendly_fire",DCS.getUnitType(arg1)) + -- Perun.LogStatsCount(arg1,"friendly_fire",DCS.getUnitType(net.get_player_info(arg1 , 'slot'))) end elseif eventName == "mission_end" then @@ -540,6 +540,10 @@ Perun.onGameEvent = function (eventName,arg1,arg2,arg3,arg4,arg5,arg6,arg7) Perun.LogStatsCount(arg1,"kill_PvP",arg2) end + if arg3 == arg6 then + Perun.LogStatsCount(arg1,"friendly_fire",arg2) + end + else _temp2 = " AI "; end