Adds some throwing datum nullchecks (#91720)

## About The Pull Request

A few places seem to call `hitby` or `throw_impact` without a throwing
datum to mimic the effect of colliding with something, which is cringe,
but I guess we should support it.

So we need to nullcheck for `get_thrower`, else it runtimes and cancels
the whole proc.

## Changelog

🆑 Melbert
fix: Glass shards from colliding with vendors or glass table hurt you
again.
/🆑
This commit is contained in:
MrMelbert
2025-06-20 11:25:16 -06:00
committed by GitHub
parent d9de687335
commit d838bff525
11 changed files with 14 additions and 14 deletions
@@ -28,7 +28,7 @@
/obj/item/freeze_cube/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
icon_state = initial(icon_state)
var/caught = hit_atom.hitby(src, FALSE, FALSE, throwingdatum=throwingdatum)
var/mob/thrown_by = throwingdatum.get_thrower()
var/mob/thrown_by = throwingdatum?.get_thrower()
if(ismovable(hit_atom) && !caught && (!thrown_by || thrown_by && COOLDOWN_FINISHED(src, freeze_cooldown)))
freeze_hit_atom(hit_atom)
if(thrown_by && !caught)