Files
Bubberstation/code/_onclick
MrMelbert 844ad39d65 Attackedby differentiates failed attacks from 0 damage attacks (#92564)
## 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
/🆑
2025-08-15 04:24:18 +02:00
..
2025-01-23 18:34:44 +01:00
2025-06-06 23:12:03 -04:00
2025-05-29 10:21:29 -07:00