mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
Guards against qdeletion in afterattack (#94211)
This commit is contained in:
@@ -69,6 +69,8 @@ GLOBAL_DATUM(bridge_axe, /obj/item/fireaxe)
|
||||
return
|
||||
if(target.resistance_flags & INDESTRUCTIBLE)
|
||||
return
|
||||
if(QDELETED(target))
|
||||
return
|
||||
if(istype(target, /obj/structure/window) || istype(target, /obj/structure/grille))
|
||||
target.atom_destruction("fireaxe")
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
// This is where stun gets applied
|
||||
/obj/item/melee/baton/afterattack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(!isliving(target) || !active || !COOLDOWN_FINISHED(src, cooldown_check) || HAS_TRAIT_FROM(target, TRAIT_IWASBATONED, REF(user)))
|
||||
if(!isliving(target) || !active || !COOLDOWN_FINISHED(src, cooldown_check) || HAS_TRAIT_FROM(target, TRAIT_IWASBATONED, REF(user)) || QDELETED(target))
|
||||
return
|
||||
// worst check in the chain but - right click = harmbaton
|
||||
if(LAZYACCESS(modifiers, RIGHT_CLICK) && !stun_on_harmbaton)
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/melee/beesword/afterattack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(iscarbon(target))
|
||||
if(iscarbon(target) && !QDELETED(target))
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
carbon_target.reagents.add_reagent(/datum/reagent/toxin, 4)
|
||||
|
||||
|
||||
@@ -1073,6 +1073,8 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
/obj/item/melee/flyswatter/afterattack(atom/target, mob/user, list/modifiers, list/attack_modifiers)
|
||||
if(is_type_in_typecache(target, splattable))
|
||||
to_chat(user, span_warning("You easily splat [target]."))
|
||||
if(QDELETED(target))
|
||||
return
|
||||
if(isliving(target))
|
||||
new /obj/effect/decal/cleanable/insectguts(target.drop_location())
|
||||
var/mob/living/bug = target
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
return
|
||||
|
||||
charged = FALSE
|
||||
if(isliving(target))
|
||||
if(isliving(target) && !QDELETED(target))
|
||||
var/mob/living/smacked = target
|
||||
smacked.take_bodypart_damage(20, 0)
|
||||
playsound(user, 'sound/items/weapons/marauder.ogg', 50, TRUE)
|
||||
|
||||
Reference in New Issue
Block a user