mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
## About The Pull Request
Fixes #92558
Currently `attacked_by` does not differentiate an attack that did 0
damage with an attack that failed (due to blocking or whatnot)
See also: This hack I left in
ce958c77c0/code/_onclick/item_attack.dm (L346-L347)
This causes problems because successful attacks can deal 0 damage. See
linked issue.
This PR addresses the issue by having `attacked_by` return `-1`
(`ATTACK_FAILED`) for attacks which entirely do not connect.
-1 was used so consumers can easily check if an attack did 0 damage OR
failed (via checking `<= 0`)
This isn't the preferred fix - I'd prefer if all block checking and zone
targeting was moved to `/item/proc/attack`, but that requires attack
itself be reigned in a bit (cuz it's still a bit of a mess).
## Changelog
🆑 Melbert
fix: Item on-attack effects will trigger as expected when hitting a limb
at damage cap
/🆑