diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index 853587888ff..c69d13d1792 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -128,7 +128,7 @@ /datum/quirk/phobia/post_add() var/mob/living/carbon/human/H = quirk_holder - H.gain_trauma(new /datum/brain_trauma/mild/phobia(H.client.prefs.phobia), TRAUMA_RESILIENCE_ABSOLUTE) + H.gain_trauma(new /datum/brain_trauma/mild/phobia(H.client?.prefs.phobia), TRAUMA_RESILIENCE_ABSOLUTE) /datum/quirk/phobia/remove() var/mob/living/carbon/human/H = quirk_holder diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index 2aeabfbad58..c6461b6baac 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -39,9 +39,10 @@ if(hotspot && istype(T) && T.air) qdel(hotspot) var/datum/gas_mixture/G = T.air - var/plas_amt = min(30,G.gases[/datum/gas/plasma][MOLES]) //Absorb some plasma - G.gases[/datum/gas/plasma][MOLES] -= plas_amt - absorbed_plasma += plas_amt + if(G.gases[/datum/gas/plasma]) + var/plas_amt = min(30,G.gases[/datum/gas/plasma][MOLES]) //Absorb some plasma + G.gases[/datum/gas/plasma][MOLES] -= plas_amt + absorbed_plasma += plas_amt if(G.temperature > T20C) G.temperature = max(G.temperature/2,T20C) G.garbage_collect() diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm index a3267218453..1631adaf37a 100644 --- a/code/game/objects/items/twohanded.dm +++ b/code/game/objects/items/twohanded.dm @@ -487,15 +487,17 @@ name = "explosive lance" var/obj/item/grenade/explosive = null -/obj/item/twohanded/spear/explosive/Initialize(mapload, obj/item/grenade/G) +/obj/item/twohanded/spear/explosive/Initialize(mapload) . = ..() - if (!G) - G = new /obj/item/grenade/iedcasing() //For admin-spawned explosive lances + set_explosive(new /obj/item/grenade/iedcasing()) //For admin-spawned explosive lances + + +/obj/item/twohanded/spear/explosive/proc/set_explosive(obj/item/grenade/G) + if(explosive) + QDEL_NULL(explosive) G.forceMove(src) explosive = G desc = "A makeshift spear with [G] attached to it" - update_icon() - /obj/item/twohanded/spear/explosive/CheckParts(list/parts_list) var/obj/item/grenade/G = locate() in parts_list @@ -507,7 +509,7 @@ icon_prefix = lancePart.icon_prefix parts_list -= G parts_list -= lancePart - Initialize(src.loc, G) + set_explosive(G) qdel(lancePart) ..() diff --git a/code/modules/antagonists/blob/blobstrains/networked_fibers.dm b/code/modules/antagonists/blob/blobstrains/networked_fibers.dm index 649ca4d44c4..67f47a4b806 100644 --- a/code/modules/antagonists/blob/blobstrains/networked_fibers.dm +++ b/code/modules/antagonists/blob/blobstrains/networked_fibers.dm @@ -34,5 +34,5 @@ /datum/reagent/blob/networked_fibers/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O) reac_volume = ..() M.apply_damage(0.6*reac_volume, BRUTE) - if(M) + if(!QDELETED(M)) M.apply_damage(0.6*reac_volume, BURN) diff --git a/code/modules/events/wizard/rpgloot.dm b/code/modules/events/wizard/rpgloot.dm index 8c98ba1dd68..b2719c03a78 100644 --- a/code/modules/events/wizard/rpgloot.dm +++ b/code/modules/events/wizard/rpgloot.dm @@ -10,7 +10,7 @@ for(var/obj/item/I in world) CHECK_TICK - if(!(I.flags_1 & INITIALIZED_1)) + if(!(I.flags_1 & INITIALIZED_1) || QDELETED(I)) continue I.AddComponent(/datum/component/fantasy) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d80ba3effcd..fc70e23645c 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -154,9 +154,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) /mob/dead/observer/Destroy() // Update our old body's medhud since we're abandoning it - if(mind) - var/mob/living/carbon/current = mind.current - current.med_hud_set_status() + if(mind && mind.current) + mind.current.med_hud_set_status() GLOB.ghost_images_default -= ghostimage_default QDEL_NULL(ghostimage_default) diff --git a/code/modules/spells/spell_types/godhand.dm b/code/modules/spells/spell_types/godhand.dm index 6f2513c9050..0cb92807c2b 100644 --- a/code/modules/spells/spell_types/godhand.dm +++ b/code/modules/spells/spell_types/godhand.dm @@ -33,7 +33,8 @@ . = ..() if(!proximity) return - user.say(catchphrase, forced = "spell") + if(catchphrase) + user.say(catchphrase, forced = "spell") playsound(get_turf(user), on_use_sound,50,TRUE) charges-- if(charges <= 0)