From 88dffc2f06927fdcc519482391c2871bbed5bb87 Mon Sep 17 00:00:00 2001 From: grungussuss <96586172+grungussuss@users.noreply.github.com> Date: Wed, 30 Apr 2025 22:23:55 +0300 Subject: [PATCH] Fixes Bane element runtime (#90889) ## About The Pull Request I spotted this when I used throw mode to hit my lizard character with the officer's sabre `check_biotype_path` in the bane element typecasts bane_applier into `/mob/living/bane_applier` and then checks for `bane_applier.combat_mode` , which runtimes if `bane_applier` doesn't actually have combat_mode. instead, let's typecast `bane_applier` into an atom and check if it's living down the line. ## Changelog :cl: grungussuss fix: fixes bane element not working if it was used by a weapon without a wielder /:cl: --------- Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> --- code/datums/elements/bane.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/datums/elements/bane.dm b/code/datums/elements/bane.dm index 110a755de23..769cf8d361d 100644 --- a/code/datums/elements/bane.dm +++ b/code/datums/elements/bane.dm @@ -76,12 +76,13 @@ * Checks typepaths and the mob's biotype, returning TRUE if correct and FALSE if wrong. * Additionally checks if combat mode is required, and if so whether it's enabled or not. */ -/datum/element/bane/proc/check_biotype_path(mob/living/bane_applier, atom/target) +/datum/element/bane/proc/check_biotype_path(atom/bane_applier, atom/target) if(!isliving(target)) return FALSE var/mob/living/living_target = target - if(bane_applier) - if(requires_combat_mode && !bane_applier.combat_mode) + if(isliving(bane_applier) && bane_applier) + var/mob/living/living_bane_applier = bane_applier + if(requires_combat_mode && !living_bane_applier.combat_mode) return FALSE var/is_correct_biotype = living_target.mob_biotypes & mob_biotypes if(mob_biotypes && !(is_correct_biotype))