Skip to content

Commit

Permalink
Merge pull request #919 from chrhasse/master
Browse files Browse the repository at this point in the history
Fix kill and damage counters related to Update 205
  • Loading branch information
Kamikaze94 committed Jul 21, 2022
2 parents 3b62b1a + 5d44a48 commit 3c4a82a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lua/DamagePopup.lua
@@ -1,4 +1,5 @@
if RequiredScript == "lib/units/enemies/cop/copdamage" then
if RequiredScript == "lib/units/enemies/cop/copdamage" and not CopDamage._damage_popup_loaded then
CopDamage._damage_popup_loaded = true
local _on_damage_received_original = CopDamage._on_damage_received
--Workaround for Teammate Headshots, since col_ray doesn't get forwarded... (self._sync_ibody_popup)
local sync_damage_bullet_original = CopDamage.sync_damage_bullet
Expand Down
3 changes: 2 additions & 1 deletion lua/GameInfoManager.lua
Expand Up @@ -2142,7 +2142,8 @@ if string.lower(RequiredScript) == "lib/network/handlers/unitnetworkhandler" the

end

if string.lower(RequiredScript) == "lib/units/enemies/cop/copdamage" then
if string.lower(RequiredScript) == "lib/units/enemies/cop/copdamage" and not CopDamage._game_info_manager_loaded then
CopDamage._game_info_manager_loaded = true

local convert_to_criminal_original = CopDamage.convert_to_criminal
local _on_damage_received_original = CopDamage._on_damage_received
Expand Down
3 changes: 2 additions & 1 deletion lua/KillCounter.lua
@@ -1,4 +1,5 @@
if RequiredScript == "lib/units/enemies/cop/copdamage" then
if RequiredScript == "lib/units/enemies/cop/copdamage" and not CopDamage._kill_counter_loaded then
CopDamage._kill_counter_loaded = true

--This needs fixing for DoT kills (then again, so does the games own kill counter) as client somehow and a lot of testing

Expand Down
4 changes: 3 additions & 1 deletion lua/TabStats.lua
Expand Up @@ -1162,7 +1162,9 @@ elseif string.lower(RequiredScript) == "lib/managers/statisticsmanager" then
local peer_name = user_id and Steam:username(user_id) or managers.localization:text("debug_undecided")
return string.format("%s (%s)", peer_name, managers.money:add_decimal_marks_to_string(tostring(max_damage)))
end
elseif string.lower(RequiredScript) == "lib/units/enemies/cop/copdamage" then
elseif string.lower(RequiredScript) == "lib/units/enemies/cop/copdamage" and not CopDamage._tab_stats_loaded then
CopDamage._tab_stats_loaded = true

local _on_damage_received_original = CopDamage._on_damage_received

function CopDamage:_on_damage_received(damage_info, ...)
Expand Down

0 comments on commit 3c4a82a

Please sign in to comment.