mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
[MIRROR] Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before. [MDB IGNORE] (#8714)
* Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before. (#61943) * Adds SHOULD_NOT_SLEEP to Destroy. Why didn't we do this before. Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
d3f9b7720e
commit
95ab2d2efb
@@ -91,6 +91,7 @@
|
||||
*/
|
||||
/datum/proc/Destroy(force=FALSE, ...)
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
SHOULD_NOT_SLEEP(TRUE)
|
||||
tag = null
|
||||
datum_flags &= ~DF_USE_TAG //In case something tries to REF us
|
||||
weak_reference = null //ensure prompt GCing of weakref.
|
||||
|
||||
@@ -128,13 +128,13 @@
|
||||
M.adjustBruteLoss(30)
|
||||
src.visible_message(span_danger("[M] falls free of [src]!"))
|
||||
unbuckle_mob(M,force=1)
|
||||
M.emote("scream")
|
||||
INVOKE_ASYNC(M, /mob/proc/emote, "scream")
|
||||
M.AdjustParalyzed(20)
|
||||
|
||||
/obj/structure/kitchenspike/Destroy()
|
||||
if(has_buckled_mobs())
|
||||
for(var/mob/living/L in buckled_mobs)
|
||||
release_mob(L)
|
||||
for(var/mob/living/spiked_lad as anything in buckled_mobs)
|
||||
release_mob(spiked_lad)
|
||||
return ..()
|
||||
|
||||
/obj/structure/kitchenspike/deconstruct(disassembled = TRUE)
|
||||
|
||||
@@ -164,7 +164,7 @@
|
||||
UnregisterSignal(attached_item, COMSIG_PARENT_QDELETING)
|
||||
qdel(attached_item)
|
||||
else if (user)
|
||||
user.put_in_hands(attached_item)
|
||||
INVOKE_ASYNC(user, /mob/proc/put_in_hands, attached_item)
|
||||
else
|
||||
attached_item.forceMove(drop_location())
|
||||
if (throwing && !QDELETED(attached_item)) //Fun little thing where we throw out the old attached item when emagged
|
||||
|
||||
@@ -134,7 +134,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
|
||||
if(C.current_ticket)
|
||||
var/datum/admin_help/T = C.current_ticket
|
||||
T.AddInteraction("Client disconnected.")
|
||||
SSblackbox.LogAhelp(T, "Disconnected", "Client disconnected", C.ckey)
|
||||
//Gotta async this cause clients only logout on destroy, and sleeping in destroy is disgusting
|
||||
INVOKE_ASYNC(SSblackbox, /datum/controller/subsystem/blackbox/proc/LogAhelp, T, "Disconnected", "Client disconnected", C.ckey)
|
||||
T.initiator = null
|
||||
|
||||
//Get a ticket given a ckey
|
||||
|
||||
@@ -113,7 +113,7 @@ GLOBAL_DATUM(current_anonymous_theme, /datum/anonymous_theme)
|
||||
continue
|
||||
var/old_name = player.real_name //before restoration
|
||||
if(issilicon(player))
|
||||
player.apply_pref_name("[isAI(player) ? /datum/preference/name/ai : /datum/preference/name/cyborg]", player.client)
|
||||
INVOKE_ASYNC(player, /mob/proc/apply_pref_name, "[isAI(player) ? /datum/preference/name/ai : /datum/preference/name/cyborg]", player.client)
|
||||
else
|
||||
player.client.prefs.apply_prefs_to(player) // This is not sound logic, as the prefs may have changed since then.
|
||||
player.fully_replace_character_name(old_name, player.real_name) //this changes IDs and PDAs and whatnot
|
||||
|
||||
@@ -117,8 +117,8 @@
|
||||
. += span_cult("This shard is spent; it is now just a creepy rock.")
|
||||
|
||||
/obj/item/soulstone/Destroy() //Stops the shade from being qdel'd immediately and their ghost being sent back to the arrival shuttle.
|
||||
for(var/mob/living/simple_animal/shade/A in src)
|
||||
A.death()
|
||||
for(var/mob/living/simple_animal/shade/shade in src)
|
||||
INVOKE_ASYNC(shade, /mob/living/proc/death)
|
||||
return ..()
|
||||
|
||||
/obj/item/soulstone/proc/hot_potato(mob/living/user)
|
||||
|
||||
@@ -206,21 +206,7 @@ and clear when youre done! if you dont i will use :newspaper2: on you
|
||||
update_use_power(active + IDLE_POWER_USE)
|
||||
program = map_id
|
||||
|
||||
//clear the items from the previous program
|
||||
for(var/holo_atom in spawned)
|
||||
derez(holo_atom)
|
||||
|
||||
for(var/obj/effect/holodeck_effect/holo_effect as anything in effects)
|
||||
effects -= holo_effect
|
||||
holo_effect.deactivate(src)
|
||||
|
||||
//makes sure that any time a holoturf is inside a baseturf list (e.g. if someone put a wall over it) its set to the OFFLINE turf
|
||||
//so that you cant bring turfs from previous programs into other ones (like putting the plasma burn turf into lounge for example)
|
||||
for(var/turf/closed/holo_turf in linked)
|
||||
for(var/baseturf in holo_turf.baseturfs)
|
||||
if(ispath(baseturf, /turf/open/floor/holofloor))
|
||||
holo_turf.baseturfs -= baseturf
|
||||
holo_turf.baseturfs += /turf/open/floor/holofloor/plating
|
||||
clear_projection()
|
||||
|
||||
template = SSmapping.holodeck_templates[map_id]
|
||||
template.load(bottom_left) //this is what actually loads the holodeck simulation into the map
|
||||
@@ -238,6 +224,34 @@ and clear when youre done! if you dont i will use :newspaper2: on you
|
||||
nerf(!(obj_flags & EMAGGED))
|
||||
finish_spawn()
|
||||
|
||||
///To be used on destroy, mainly to prevent sleeping inside well, destroy. Missing a lot of the things contained in load_program
|
||||
/obj/machinery/computer/holodeck/proc/reset_to_default()
|
||||
if (program == offline_program)
|
||||
return
|
||||
|
||||
program = offline_program
|
||||
clear_projection()
|
||||
|
||||
template = SSmapping.holodeck_templates[offline_program]
|
||||
INVOKE_ASYNC(template, /datum/map_template/proc/load, bottom_left) //this is what actually loads the holodeck simulation into the map
|
||||
|
||||
/obj/machinery/computer/holodeck/proc/clear_projection()
|
||||
//clear the items from the previous program
|
||||
for(var/holo_atom in spawned)
|
||||
derez(holo_atom)
|
||||
|
||||
for(var/obj/effect/holodeck_effect/holo_effect as anything in effects)
|
||||
effects -= holo_effect
|
||||
holo_effect.deactivate(src)
|
||||
|
||||
//makes sure that any time a holoturf is inside a baseturf list (e.g. if someone put a wall over it) its set to the OFFLINE turf
|
||||
//so that you cant bring turfs from previous programs into other ones (like putting the plasma burn turf into lounge for example)
|
||||
for(var/turf/closed/holo_turf in linked)
|
||||
for(var/baseturf in holo_turf.baseturfs)
|
||||
if(ispath(baseturf, /turf/open/floor/holofloor))
|
||||
holo_turf.baseturfs -= baseturf
|
||||
holo_turf.baseturfs += /turf/open/floor/holofloor/plating
|
||||
|
||||
///finalizes objects in the spawned list
|
||||
/obj/machinery/computer/holodeck/proc/finish_spawn()
|
||||
for(var/atom/holo_atom as anything in spawned)
|
||||
@@ -393,7 +407,7 @@ and clear when youre done! if you dont i will use :newspaper2: on you
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/holodeck/Destroy()
|
||||
emergency_shutdown()
|
||||
reset_to_default()
|
||||
if(linked)
|
||||
linked.linked = null
|
||||
linked.power_usage = list(AREA_USAGE_LEN)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
for(var/i in reserved_turfs)
|
||||
reserved_turfs -= i
|
||||
SSmapping.used_turfs -= i
|
||||
SSmapping.reserve_turfs(v)
|
||||
INVOKE_ASYNC(SSmapping, /datum/controller/subsystem/mapping/proc/reserve_turfs, v)
|
||||
|
||||
/datum/turf_reservation/proc/Reserve(width, height, zlevel)
|
||||
if(width > world.maxx || height > world.maxy || width < 1 || height < 1)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
update_appearance()
|
||||
|
||||
/obj/item/modular_computer/Destroy()
|
||||
kill_program(forced = TRUE)
|
||||
wipe_program(forced = TRUE)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
for(var/port in all_components)
|
||||
var/obj/item/computer_hardware/component = all_components[port]
|
||||
@@ -410,14 +410,20 @@
|
||||
data["PC_showexitprogram"] = active_program ? 1 : 0 // Hides "Exit Program" button on mainscreen
|
||||
return data
|
||||
|
||||
///Wipes the computer's current program. Doesn't handle any of the niceties around doing this
|
||||
/obj/item/modular_computer/proc/wipe_program(forced)
|
||||
if(!active_program)
|
||||
return
|
||||
active_program.kill_program(forced)
|
||||
active_program = null
|
||||
|
||||
// Relays kill program request to currently active program. Use this to quit current program.
|
||||
/obj/item/modular_computer/proc/kill_program(forced = FALSE)
|
||||
if(active_program)
|
||||
active_program.kill_program(forced)
|
||||
active_program = null
|
||||
wipe_program(forced)
|
||||
var/mob/user = usr
|
||||
if(user && istype(user))
|
||||
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
|
||||
//Here to prevent programs sleeping in destroy
|
||||
INVOKE_ASYNC(src, /datum/proc/ui_interact, user) // Re-open the UI on this computer. It should show the main screen now.
|
||||
update_appearance()
|
||||
|
||||
// Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on)
|
||||
|
||||
@@ -1202,7 +1202,7 @@
|
||||
to_chat(occupier, span_danger("Primary core damaged, unable to return core processes."))
|
||||
if(forced)
|
||||
occupier.forceMove(drop_location())
|
||||
occupier.death()
|
||||
INVOKE_ASYNC(occupier, /mob/living/proc/death)
|
||||
occupier.gib()
|
||||
|
||||
if(!occupier.nuking) //Pinpointers go back to tracking the nuke disk, as long as the AI (somehow) isn't mid-nuking.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
ME.attach(src)
|
||||
|
||||
/obj/vehicle/sealed/mecha/working/clarke/Destroy()
|
||||
box.dump_box_contents()
|
||||
INVOKE_ASYNC(box, /obj/structure/ore_box/proc/dump_box_contents)
|
||||
return ..()
|
||||
|
||||
/obj/vehicle/sealed/mecha/working/clarke/moved_inside(mob/living/carbon/human/H)
|
||||
|
||||
Reference in New Issue
Block a user