diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 5d00175f28a..5165bc2e36f 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -181,9 +181,9 @@ ///Handles random hardcore point rewarding if it applies. /datum/controller/subsystem/ticker/proc/HandleRandomHardcoreScore(client/player_client) - if(!ishuman(player_client.mob)) + if(!ishuman(player_client?.mob)) return FALSE - var/mob/living/carbon/human/human_mob = player_client.mob + var/mob/living/carbon/human/human_mob = player_client?.mob if(!human_mob.hardcore_survival_score) ///no score no glory return FALSE @@ -197,9 +197,9 @@ didthegamerwin = FALSE if(!didthegamerwin) return FALSE - player_client.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score * 2)) + player_client?.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score * 2)) else if(human_mob.onCentCom()) - player_client.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score)) + player_client?.give_award(/datum/award/score/hardcore_random, human_mob, round(human_mob.hardcore_survival_score)) /datum/controller/subsystem/ticker/proc/declare_completion() @@ -218,11 +218,11 @@ speed_round = TRUE for(var/client/C in GLOB.clients) - if(!C.credits) - C.RollCredits() - C.playtitlemusic(40) + if(!C?.credits) + C?.RollCredits() + C?.playtitlemusic(40) if(speed_round) - C.give_award(/datum/award/achievement/misc/speed_round, C.mob) + C?.give_award(/datum/award/achievement/misc/speed_round, C?.mob) HandleRandomHardcoreScore(C) var/popcount = gather_roundend_feedback() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index bcd28259308..64a51f32302 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -285,13 +285,13 @@ GLOBAL_LIST_EMPTY(cryopod_computers) crew_member["job"] = "N/A" // Delete them from datacore. var/announce_rank = null - for(var/datum/data/record/medical_record in GLOB.data_core.medical) + for(var/datum/data/record/medical_record as anything in GLOB.data_core.medical) if(medical_record.fields["name"] == mob_occupant.real_name) qdel(medical_record) - for(var/datum/data/record/security_record in GLOB.data_core.security) + for(var/datum/data/record/security_record as anything in GLOB.data_core.security) if(security_record.fields["name"] == mob_occupant.real_name) qdel(security_record) - for(var/datum/data/record/general_record in GLOB.data_core.general) + for(var/datum/data/record/general_record as anything in GLOB.data_core.general) if(general_record.fields["name"] == mob_occupant.real_name) announce_rank = general_record.fields["rank"] qdel(general_record) diff --git a/code/game/objects/effects/proximity.dm b/code/game/objects/effects/proximity.dm index 49241255a12..a6c64f63d3c 100644 --- a/code/game/objects/effects/proximity.dm +++ b/code/game/objects/effects/proximity.dm @@ -118,6 +118,7 @@ return /obj/effect/abstract/proximity_checker/Destroy() + monitor.checkers -= src monitor = null return ..() diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index fe825511822..6e675a51728 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -253,7 +253,7 @@ var/turf/position = get_turf(src) for(var/obj/item/jammer/jammer in GLOB.active_jammers) var/turf/jammer_turf = get_turf(jammer) - if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) <= jammer.range)) + if(position?.z == jammer_turf.z && (get_dist(position, jammer_turf) <= jammer.range)) return // Determine the identity information which will be attached to the signal. diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm index 65af1ae5f22..6dd93887a07 100644 --- a/code/game/objects/items/robot/robot_items.dm +++ b/code/game/objects/items/robot/robot_items.dm @@ -796,8 +796,7 @@ RegisterSignal(loc.loc, COMSIG_BORG_SAFE_DECONSTRUCT, .proc/safedecon) /obj/item/borg/apparatus/Destroy() - if(stored) - qdel(stored) + QDEL_NULL(stored) . = ..() ///If we're safely deconstructed, we put the item neatly onto the ground, rather than deleting it. @@ -894,7 +893,7 @@ if(stored) var/obj/item/reagent_containers/C = stored C.SplashReagents(get_turf(src)) - qdel(stored) + QDEL_NULL(stored) . = ..() /obj/item/borg/apparatus/beaker/examine() diff --git a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm index 677d612ebf4..35798e81156 100644 --- a/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm +++ b/code/modules/reagents/chemistry/machinery/chem_synthesizer.dm @@ -57,6 +57,10 @@ purity = input update_appearance() +/obj/machinery/chem_dispenser/chem_synthesizer/Destroy() + QDEL_NULL(beaker) + return ..() + /obj/machinery/chem_dispenser/chem_synthesizer/ui_data(mob/user) . = ..() .["purity"] = purity diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index 4e06d6a0eb6..000e512ee16 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -45,10 +45,14 @@ QDEL_NULL(beaker) update_appearance() -/obj/machinery/reagentgrinder/Destroy() - if(beaker) - beaker.forceMove(drop_location()) +/obj/machinery/reagentgrinder/deconstruct() drop_all_items() + beaker?.forceMove(drop_location()) + beaker = null + return ..() + +/obj/machinery/reagentgrinder/Destroy() + QDEL_NULL(beaker) return ..() /obj/machinery/reagentgrinder/contents_explosion(severity, target)