Fixes a logic error in disposal bin hitby (thrown objects don't always have a throwing mob) (#73296)

A throwing datum does not always have a throwing mob, and code should
respect that
This commit is contained in:
Zephyr
2023-02-10 14:59:29 +00:00
committed by GitHub
parent 2f6ed372ec
commit 987de55275
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ SUBSYSTEM_DEF(throwing)
var/maxrange
///The speed of the projectile thrownthing being thrown.
var/speed
///If a mob is the one who has thrown the object, then it's moved here.
///If a mob is the one who has thrown the object, then it's moved here. This can be null and must be null checked before trying to use it.
var/mob/thrower
///A variable that helps in describing objects thrown at an angle, if it should be moved diagonally first or last.
var/diagonals_first
+1 -1
View File
@@ -383,7 +383,7 @@
/obj/machinery/disposal/bin/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(isitem(AM) && AM.CanEnterDisposals())
if(HAS_TRAIT(throwingdatum.thrower, TRAIT_THROWINGARM) || prob(75))
if((throwingdatum.thrower && HAS_TRAIT(throwingdatum.thrower, TRAIT_THROWINGARM)) || prob(75))
AM.forceMove(src)
visible_message(span_notice("[AM] lands in [src]."))
update_appearance()