Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix kill and damage counters related to Update 205 #919

Merged
merged 1 commit into from Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -2136,7 +2136,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