ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
635 stars 74 forks source link

[TF2] [Bug] HUD damage numbers overflow at the 16-bit integer limit #6376

Open CookieCat45 opened 1 week ago

CookieCat45 commented 1 week ago

If a player deals damage to an entity and that damage exceeds the 16-bit integer limit (32767) the damage displayed on the HUD will overflow and wrap around to 0. The actual damage being dealt will still be the same, but the damage displayed on the HUD will overflow.

Here is a demonstration. I've used a SourceMod plugin to change all damage dealt to buildings to be 40000. As you can see from the chat, the damage being dealt is actually 40000. But the damage displayed on the HUD overflows and displays as 7232. 32768+7232 = 40000

https://github.com/user-attachments/assets/5feff66b-2359-4798-b8cc-9c7466d07c98

ChaseTownsend commented 5 days ago

One weird fact is that if you have hud_combattext_batching_window set to like 2 and deal constant damage it goes over the 16-bit interger and just can't show over 32768 damage in a single attack