diff --git a/code/controllers/subsystems/player_tips.dm b/code/controllers/subsystems/player_tips.dm index 8afa6cc5b5..60b99598a4 100644 --- a/code/controllers/subsystems/player_tips.dm +++ b/code/controllers/subsystems/player_tips.dm @@ -7,6 +7,17 @@ SUBSYSTEM_DEF(player_tips) flags = SS_NO_INIT var/static/datum/player_tips/player_tips = new + var/list/current_run = list() -/datum/controller/subsystem/player_tips/fire() - player_tips.send_tips() +/datum/controller/subsystem/player_tips/fire(resumed) + if(!resumed) + if(!player_tips.check_next_tip()) + return + player_tips.set_current_tip() + current_run = GLOB.player_list.Copy() + + for(var/mob/target_mob in current_run) + current_run -= target_mob + player_tips.send_tip(target_mob) + if(MC_TICK_CHECK) + return diff --git a/code/game/mecha/space/hoverpod.dm b/code/game/mecha/space/hoverpod.dm index fcb9fee999..10190d4e84 100644 --- a/code/game/mecha/space/hoverpod.dm +++ b/code/game/mecha/space/hoverpod.dm @@ -31,6 +31,10 @@ ion_trail = new /datum/effect/effect/system/ion_trail_follow() ion_trail.set_up(src) +/obj/mecha/working/hoverpod/Destroy() + QDEL_NULL(ion_trail) + . = ..() + /obj/mecha/working/hoverpod/moved_inside(var/mob/living/carbon/human/H as mob) . = ..(H) if(.) diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index 6366a9445b..fffdd4046b 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -411,9 +411,9 @@ QDEL_NULL(exonet) last_camera_turf = null - qdel(cam_screen) + QDEL_NULL(cam_screen) QDEL_LIST(cam_plane_masters) - qdel(cam_background) + QDEL_NULL(cam_background) return ..() diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 3b182801d1..ef78b0c58c 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -424,6 +424,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(holder) holder.owner = null GLOB.admins -= src + if(skybox) + QDEL_NULL(skybox) QDEL_NULL(loot_panel) ..() diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index 4d797697d6..b3ed6f41b3 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -74,10 +74,10 @@ // Spawn a single carp at given location. /datum/event/carp_migration/proc/spawn_one_carp(var/loc) - var/mob/living/simple_mob/animal/M = new /mob/living/simple_mob/animal/space/carp/event(loc) - RegisterSignal(M, COMSIG_OBSERVER_DESTROYED, PROC_REF(on_carp_destruction)) - spawned_carp.Add(M) - return M + var/mob/living/simple_mob/animal/carp_to_spawn = new /mob/living/simple_mob/animal/space/carp/event(loc) + RegisterSignal(carp_to_spawn, COMSIG_OBSERVER_DESTROYED, PROC_REF(on_carp_destruction)) + spawned_carp.Add(carp_to_spawn) + return carp_to_spawn // Counts living carp spawned by this event. /datum/event/carp_migration/proc/count_spawned_carps() @@ -87,10 +87,10 @@ . += 1 // If carp is bomphed, remove it from the list. -/datum/event/carp_migration/proc/on_carp_destruction(var/mob/M) +/datum/event/carp_migration/proc/on_carp_destruction(datum/source, mob/carp_to_remove) SIGNAL_HANDLER - spawned_carp -= M - UnregisterSignal(M, COMSIG_OBSERVER_DESTROYED) + spawned_carp -= carp_to_remove + UnregisterSignal(carp_to_remove, COMSIG_OBSERVER_DESTROYED) /datum/event/carp_migration/end() . = ..() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 59c207329c..4727fcdc6c 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1467,6 +1467,8 @@ if(screen_icon) owner?.client?.screen -= screen_icon UnregisterSignal(screen_icon, COMSIG_CLICK) + var/datum/hud/HUD = owner?.hud_used + LAZYREMOVE(HUD?.other_important, screen_icon) QDEL_NULL(screen_icon) /datum/component/character_setup/proc/create_mob_button(mob/user) diff --git a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/hoverpod.dm b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/hoverpod.dm index f1fabed013..fcae342279 100644 --- a/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/hoverpod.dm +++ b/code/modules/mob/living/simple_mob/subtypes/mechanical/mecha/hoverpod.dm @@ -41,6 +41,10 @@ ion_trail.start() return ..() +/mob/living/simple_mob/mechanical/mecha/hoverpod/Destroy() + QDEL_NULL(ion_trail) + . = ..() + /mob/living/simple_mob/mechanical/mecha/hoverpod/Process_Spacemove(var/check_drift = 0) return TRUE diff --git a/code/modules/mob/new_player/logout.dm b/code/modules/mob/new_player/logout.dm index 0b1c17ced8..1963a4fa7d 100644 --- a/code/modules/mob/new_player/logout.dm +++ b/code/modules/mob/new_player/logout.dm @@ -2,7 +2,6 @@ ready = 0 GLOB.new_player_list -= src - QDEL_NULL(lobby_window) disable_lobby_browser() ..() @@ -17,6 +16,10 @@ return /mob/new_player/proc/disable_lobby_browser() + if(lobby_window) + lobby_window.unsubscribe(src) + lobby_window.close() + lobby_window = null var/client/exiting_client = persistent_client.client if(exiting_client) winset(exiting_client, "lobby_browser", "is-disabled=true;is-visible=false") diff --git a/code/modules/player_tips_vr/player_tips_controller_vr.dm b/code/modules/player_tips_vr/player_tips_controller_vr.dm index cb702728d4..a20efefe9f 100644 --- a/code/modules/player_tips_vr/player_tips_controller_vr.dm +++ b/code/modules/player_tips_vr/player_tips_controller_vr.dm @@ -14,29 +14,31 @@ Controlled by the player_tips subsystem under code/controllers/subsystems/player var/list/HasReceived = list() //Tracking who received tips. We let them know how to turn them off if they're not on this list. Stores CKeys until round-end. //Called every 5 minutes as defined in the subsystem. -/datum/player_tips/proc/send_tips() - if(world.time > last_tip_time + tip_delay) - last_tip_time = world.time - tip_delay = rand(min_tip_delay, max_tip_delay) - var/tip = pick_tip("none") //"none" picks a random topic of advice. - var/stopWhile = 0 - while(tip == last_tip) //Prevent posting the same tip twice in a row if possible, but don't force it. - tip = pick_tip("none") - stopWhile = stopWhile + 1 - if(stopWhile >= 10) - break - last_tip = tip - for(var/mob/M in GLOB.player_list) - if(M.client?.prefs?.read_preference(/datum/preference/toggle/player_tips)) - if(!M.key && !(M.key in HasReceived)) - to_chat(M, span_warning("You have periodic player tips enabled. You may turn them off at any time with the Toggle Receiving Player Tips verb in Preferences, or in character set up under the OOC tab!\n Player tips appear every 45-75 minutes.")) - HasReceived.Add(M.key) - tip = GLOB.is_valid_url.Replace(tip,span_linkify("$1")) - to_chat(M, span_notice("[tip]")) - +/datum/player_tips/proc/check_next_tip() + if(world.time <= last_tip_time + tip_delay) + return FALSE + last_tip_time = world.time + tip_delay = rand(min_tip_delay, max_tip_delay) + return TRUE +/datum/player_tips/proc/set_current_tip() + var/tip = pick_tip("none") //"none" picks a random topic of advice. + var/stopWhile = 0 + while(tip == last_tip) //Prevent posting the same tip twice in a row if possible, but don't force it. + tip = pick_tip("none") + stopWhile = stopWhile + 1 + if(stopWhile >= 10) + break + last_tip = tip +/datum/player_tips/proc/send_tip(mob/target_mob) + if(!(target_mob.client?.prefs?.read_preference(/datum/preference/toggle/player_tips))) + return + if(target_mob.key && !(target_mob.key in HasReceived)) + to_chat(target_mob, span_warning("You have periodic player tips enabled. You may turn them off at any time with the Toggle Receiving Player Tips verb in Preferences, or in character set up under the OOC tab!\n Player tips appear every 45-75 minutes.")) + HasReceived.Add(target_mob.key) + to_chat(target_mob, span_notice("[GLOB.is_valid_url.Replace(last_tip, span_linkify("$1"))]")) /mob/living/verb/request_automated_advice() set name = "Request Automated Advice" @@ -47,4 +49,4 @@ Controlled by the player_tips subsystem under code/controllers/subsystems/player if(choice == "cancel") return var/static/datum/player_tips/player_tips = new - to_chat(src, span_notice("[GLOB.is_valid_url.Replace(player_tips.pick_tip(choice),span_linkify("$1"))]")) + to_chat(src, span_notice("[GLOB.is_valid_url.Replace(player_tips.pick_tip(choice), span_linkify("$1"))]")) diff --git a/code/modules/tgui/modules/appearance_changer.dm b/code/modules/tgui/modules/appearance_changer.dm index b2f51b609f..cc0a8a0819 100644 --- a/code/modules/tgui/modules/appearance_changer.dm +++ b/code/modules/tgui/modules/appearance_changer.dm @@ -102,9 +102,9 @@ cut_data() /datum/tgui_module/appearance_changer/Destroy() - qdel(cam_screen) + QDEL_NULL(cam_screen) QDEL_LIST(cam_plane_masters) - qdel(cam_background) + QDEL_NULL(cam_background) return ..() /datum/tgui_module/appearance_changer/tgui_act(action, list/params, datum/tgui/ui, datum/tgui_state/state) diff --git a/code/modules/tgui/tgui_window.dm b/code/modules/tgui/tgui_window.dm index 4c2b285cae..995376fb5a 100644 --- a/code/modules/tgui/tgui_window.dm +++ b/code/modules/tgui/tgui_window.dm @@ -221,6 +221,9 @@ */ /datum/tgui_window/proc/close(can_be_suspended = TRUE) if(!client) + release_lock() + status = TGUI_WINDOW_CLOSED + message_queue = null return if(can_be_suspended && can_be_suspended()) #ifdef TGUI_DEBUGGING diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 2dae302ced..3c47deadd2 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1307,6 +1307,8 @@ if(screen_icon) owner?.client?.screen -= screen_icon UnregisterSignal(screen_icon, COMSIG_CLICK) + var/datum/hud/HUD = owner?.hud_used + LAZYREMOVE(HUD?.other_important, screen_icon) QDEL_NULL(screen_icon) remove_verb(owner, /mob/proc/insidePanel) QDEL_NULL(owner.vorePanel) diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx index cb72cf858f..32d4d54555 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx @@ -9,9 +9,9 @@ type Data = { categories: string[]; selected_category: { name: string; - items: any; + items: Record; }; - selected_category_static: any; + selected_category_static: Record; saved_notification: BooleanLike; preview_loadout: BooleanLike;