soundloop fix. also it gets deleted (woo)

This commit is contained in:
LetterN
2021-10-30 13:16:31 +08:00
parent ec85d5575d
commit 1fc778f70a
8 changed files with 50 additions and 25 deletions
+5 -1
View File
@@ -20,12 +20,16 @@
/obj/item/clothing/head/helmet/space/hardsuit/Initialize()
. = ..()
soundloop = new(list(), FALSE, TRUE)
soundloop = new(src, FALSE, TRUE)
soundloop.volume = 5
START_PROCESSING(SSobj, src)
/obj/item/clothing/head/helmet/space/hardsuit/Destroy()
. = ..()
if(!QDELETED(suit))
qdel(suit)
suit = null
QDEL_NULL(soundloop)
STOP_PROCESSING(SSobj, src)
/obj/item/clothing/head/helmet/space/hardsuit/attack_self(mob/user)
@@ -57,7 +57,11 @@ God bless America.
component_parts += new /obj/item/circuitboard/machine/deep_fryer(null)
component_parts += new /obj/item/stock_parts/micro_laser(null)
RefreshParts()
fry_loop = new(list(src), FALSE)
fry_loop = new(src, FALSE)
/obj/machinery/deepfryer/Destroy()
QDEL_NULL(fry_loop)
return ..()
/obj/machinery/deepfryer/RefreshParts()
var/oil_efficiency
@@ -13,15 +13,21 @@
/obj/machinery/grill/Initialize()
. = ..()
grill_loop = new(list(src), FALSE)
grill_loop = new(src, FALSE)
/obj/machinery/grill/Destroy()
QDEL_NULL(grill_loop)
return ..()
/obj/machinery/grill/update_icon_state()
if(grilled_item)
icon_state = "grill"
else if(grill_fuel)
return ..()
if(grill_fuel > 0)
icon_state = "grill_on"
else
icon_state = "grill_open"
return ..()
icon_state = "grill_open"
return ..()
/obj/machinery/grill/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/stack/sheet/mineral/coal) || istype(I, /obj/item/stack/sheet/mineral/wood))
@@ -60,21 +66,21 @@
return
..()
/obj/machinery/grill/process()
/obj/machinery/grill/process(delta_time)
..()
update_icon()
if(!grill_fuel)
update_appearance()
if(grill_fuel <= 0)
return
else
grill_fuel -= 1
if(prob(1))
grill_fuel -= 0.5 * delta_time
if(DT_PROB(0.5, delta_time))
var/datum/effect_system/smoke_spread/bad/smoke = new
smoke.set_up(1, loc)
smoke.start()
if(grilled_item)
grill_time += 1
grill_time += delta_time
grilled_item.reagents.add_reagent("char", 1)
grill_fuel -= 10
grill_fuel -= 5 * delta_time
grilled_item.AddComponent(/datum/component/sizzle)
/obj/machinery/grill/Exited(atom/movable/AM)
@@ -109,9 +115,9 @@
/obj/machinery/grill/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
if(grilled_item)
to_chat(user, "<span class='notice'>You take out [grilled_item] from [src].</span>")
to_chat(user, span_notice("You take out [grilled_item] from [src]."))
grilled_item.forceMove(drop_location())
update_icon()
update_appearance()
return
return ..()
@@ -36,12 +36,13 @@
. = ..()
wires = new /datum/wires/microwave(src)
create_reagents(100)
soundloop = new(list(src), FALSE)
soundloop = new(src, FALSE)
/obj/machinery/microwave/Destroy()
eject()
if(wires)
QDEL_NULL(wires)
QDEL_NULL(soundloop)
. = ..()
/obj/machinery/microwave/RefreshParts()
+1 -1
View File
@@ -19,7 +19,7 @@
/obj/machinery/power/port_gen/Initialize()
. = ..()
soundloop = new(list(src), active)
soundloop = new(src, active)
/obj/machinery/power/port_gen/Destroy()
QDEL_NULL(soundloop)
@@ -210,7 +210,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
AddElement(/datum/element/bsa_blocker)
RegisterSignal(src, COMSIG_ATOM_BSA_BEAM, .proc/call_explode)
soundloop = new(list(src), TRUE)
soundloop = new(src, TRUE)
/obj/machinery/power/supermatter_crystal/Destroy()
investigate_log("has been destroyed.", INVESTIGATE_SUPERMATTER)
@@ -220,6 +220,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
QDEL_NULL(countdown)
if(is_main_engine && GLOB.main_supermatter_engine == src)
GLOB.main_supermatter_engine = null
QDEL_NULL(soundloop)
return ..()
/obj/machinery/power/supermatter_crystal/examine(mob/user)