Open vrad-exe opened 1 year ago
This seems to actually apply to all damage, not just these inputs. Portal turrets will probably need their damage halved to account for this being fixed, otherwise most existing Portal stuff is instakill so it shouldn't change much.
To add to this, I don't think we should keep this behavior for backwards compatibility, for these inputs or for anything else. Backwards compat is good up to a point, but it's really not worth it when doing so requires keeping around bugs that are incredibly unintuitive to work with (when you tell the player to take 50 damage, they should take 50 damage, not 25). Especially for something like this, since most stuff in Portal is instant death anyway, and most of the common things that aren't (e.g. turrets) use hardcoded damage values which could be halved in code to compensate for the fix.
Turns out this is actually because of a cvar sk_dmg_take_scale1
being defaulted to 0.5
, I guess it's a weird leftover from the hl2 difficulty system then? I don't know honestly
Describe the bug
~The
SetHealth
andRemoveHealth
inputs appear to not lower health correctly in Portal 2; they only do half the damage they are supposed to, resulting in the entity's health not actually being set to the value specified, but to something higher.~All player damage appears to be halved compared to the values specified. This apples to the
SetHealth
andRemoveHealth
inputs, as well as other sources (e.g. HL2 weapons do half damage compared to what is specified in the skill cvars, poison headcrabs take half of the player's current health instead of lowering to 1)If the player's health is visualized (e.g. with
player_debug_print_damage
or VScript), you can see that it seems to always deal exactly half of the damage it should; forSetHealth
it's(current health - target health) / 2
, while forRemoveHealth
this istarget damage / 2
.This doesn't happen when increasing the player's health. I only checked this with players, unsure if it also affects other entities.
Issue Map
Any
To Reproduce
player_debug_print_damage
ent_fire !self SetHealth 0
Operating System
Tested on Windows 10