From 7bb73bcfb88cc6d5738edb0e920fb49f82516303 Mon Sep 17 00:00:00 2001 From: vuonojenmustaturska Date: Sun, 19 May 2019 18:52:59 +0300 Subject: [PATCH] Fixes a bunch of harddels and weirdness. (#44012) * grabbag of random things * followup * deleet --- code/datums/radiation_wave.dm | 4 +++- code/game/machinery/_machinery.dm | 4 ++++ .../effects/effect_system/effect_system.dm | 3 +++ .../effects/effect_system/effects_explosion.dm | 18 +++++++++++------- .../effects/effect_system/effects_sparks.dm | 8 ++++++-- code/game/objects/items/cards_ids.dm | 13 ++++++++++--- code/modules/power/turbine.dm | 11 +++++++++++ 7 files changed, 48 insertions(+), 13 deletions(-) diff --git a/code/datums/radiation_wave.dm b/code/datums/radiation_wave.dm index 5fb777f9c57..949e63dc6a7 100644 --- a/code/datums/radiation_wave.dm +++ b/code/datums/radiation_wave.dm @@ -9,7 +9,9 @@ var/can_contaminate /datum/radiation_wave/New(atom/_source, dir, _intensity=0, _range_modifier=RAD_DISTANCE_COEFFICIENT, _can_contaminate=TRUE) - source = _source + + source = "[_source] \[[REF(_source)]\]" + master_turf = get_turf(_source) move_dir = dir diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index c537150ec59..2c7fde9dfe0 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -147,6 +147,10 @@ Class Procs: else STOP_PROCESSING(SSfastprocess, src) dropContents() + if(length(component_parts)) + for(var/atom/A in component_parts) + qdel(A) + component_parts.Cut() return ..() /obj/machinery/proc/locate_machinery() diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index eb4c562c369..e2bc6f54ec1 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -20,6 +20,9 @@ would spawn and follow the beaker, even if it is carried or thrown. GLOB.cameranet.updateVisibility(src) return ..() +/obj/effect/particle_effect/newtonian_move() // Prevents effects from getting registered for SSspacedrift + return TRUE + /datum/effect_system var/number = 3 var/cardinals = FALSE diff --git a/code/game/objects/effects/effect_system/effects_explosion.dm b/code/game/objects/effects/effect_system/effects_explosion.dm index d208510e860..c91df696e6c 100644 --- a/code/game/objects/effects/effect_system/effects_explosion.dm +++ b/code/game/objects/effects/effect_system/effects_explosion.dm @@ -5,19 +5,23 @@ anchored = TRUE /obj/effect/particle_effect/expl_particles/Initialize() - . = ..() - QDEL_IN(src, 15) + ..() + return INITIALIZE_HINT_LATELOAD + +/obj/effect/particle_effect/expl_particles/LateInitialize() + var/direct = pick(GLOB.alldirs) + var/steps_amt = pick(1;25,2;50,3,4;200) + for(var/j in 1 to steps_amt) + step(src, direct) + sleep(1) + qdel(src) /datum/effect_system/expl_particles number = 10 /datum/effect_system/expl_particles/start() for(var/i in 1 to number) - var/obj/effect/particle_effect/expl_particles/expl = new /obj/effect/particle_effect/expl_particles(location) - var/direct = pick(GLOB.alldirs) - var/steps_amt = pick(1;25,2;50,3,4;200) - for(var/j in 1 to steps_amt) - addtimer(CALLBACK(GLOBAL_PROC, .proc/_step, expl, direct), j) + new /obj/effect/particle_effect/expl_particles(location) /obj/effect/explosion name = "fire" diff --git a/code/game/objects/effects/effect_system/effects_sparks.dm b/code/game/objects/effects/effect_system/effects_sparks.dm index 6da00041048..2912cffccd9 100644 --- a/code/game/objects/effects/effect_system/effects_sparks.dm +++ b/code/game/objects/effects/effect_system/effects_sparks.dm @@ -25,13 +25,17 @@ light_color = LIGHT_COLOR_FIRE /obj/effect/particle_effect/sparks/Initialize() - . = ..() + ..() + return INITIALIZE_HINT_LATELOAD + +/obj/effect/particle_effect/sparks/LateInitialize() flick("sparks", src) // replay the animation playsound(src, "sparks", 100, TRUE) var/turf/T = loc if(isturf(T)) T.hotspot_expose(1000,100) - QDEL_IN(src, 20) + sleep(20) + qdel(src) /obj/effect/particle_effect/sparks/Destroy() var/turf/T = loc diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 5f24b69ab46..384965149af 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -125,6 +125,13 @@ if(mapload && access_txt) access = text2access(access_txt) +/obj/item/card/id/Destroy() + if (registered_account) + registered_account.bank_cards -= src + if (my_store && my_store.my_card == src) + my_store.my_card = null + return ..() + /obj/item/card/id/attack_self(mob/user) if(Adjacent(user)) user.visible_message("[user] shows you: [icon2html(src, viewers(user))] [src.name].", "You show \the [src.name].") @@ -175,7 +182,7 @@ return if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) return - + return TRUE /obj/item/card/id/AltClick(mob/living/user) @@ -199,7 +206,7 @@ return if (world.time < registered_account.withdrawDelay) - registered_account.bank_card_talk("ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS.", TRUE) + registered_account.bank_card_talk("ERROR: UNABLE TO LOGIN DUE TO SCHEDULED MAINTENANCE. MAINTENANCE IS SCHEDULED TO COMPLETE IN [(registered_account.withdrawDelay - world.time)/10] SECONDS.", TRUE) return var/amount_to_remove = FLOOR(input(user, "How much do you want to withdraw? Current Balance: [registered_account.account_balance]", "Withdraw Funds", 5) as num, 1) @@ -216,7 +223,7 @@ return else var/difference = amount_to_remove - registered_account.account_balance - registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) + registered_account.bank_card_talk("ERROR: The linked account requires [difference] more credit\s to perform that withdrawal.", TRUE) /obj/item/card/id/examine(mob/user) ..() diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 994216e584a..21d7d2ccc01 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -41,6 +41,11 @@ var/comp_id = 0 var/efficiency +/obj/machinery/power/compressor/Destroy() + if (turbine && turbine.compressor == src) + turbine.compressor = null + turbine = null + return ..() /obj/machinery/power/turbine name = "gas turbine generator" @@ -57,6 +62,12 @@ var/lastgen var/productivity = 1 +/obj/machinery/power/turbine/Destroy() + if (compressor && compressor.turbine == src) + compressor.turbine = null + compressor = null + return ..() + /obj/machinery/computer/turbine_computer name = "gas turbine control computer" desc = "A computer to remotely control a gas turbine."