diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 002b3ecc691..8dd95119aff 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -59,7 +59,7 @@ GLOBAL_DATUM_INIT(pipe_icon_manager, /datum/pipe_icon_manager, new()) for(var/mob/living/L in src) //ventcrawling is serious business L.remove_ventcrawl() L.forceMove(get_turf(src)) - QDEL_NULL(pipe_image) //we have to del it, or it might keep a ref somewhere else + QDEL_NULL(pipe_image) //we have to qdel it, or it might keep a ref somewhere else return ..() // Icons/overlays/underlays diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index b519130bb4f..bd077204f00 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -344,7 +344,7 @@ for(var/i = 1; i <= GLOB.player_list.len; i++) var/mob/M = GLOB.player_list[i] if(M && M.client) - if(istype(M, /mob/new_player)) // exclude people in the lobby + if(isnewplayer(M)) // exclude people in the lobby continue else if(isobserver(M)) // Ghosts are fine if they were playing once (didn't start as observers) var/mob/dead/observer/O = M diff --git a/code/__HELPERS/unique_ids.dm b/code/__HELPERS/unique_ids.dm index 549f5c71016..b66b1a11b90 100644 --- a/code/__HELPERS/unique_ids.dm +++ b/code/__HELPERS/unique_ids.dm @@ -16,8 +16,6 @@ GLOBAL_VAR_INIT(next_unique_datum_id, 1) -// /client/var/tmp/unique_datum_id = null - /datum/proc/UID() if(!unique_datum_id) var/tag_backup = tag @@ -37,8 +35,6 @@ GLOBAL_VAR_INIT(next_unique_datum_id, 1) var/datum/D = locate(copytext(uid, 1, splitat)) - // We might locate a client instead of a datum, but just using : is easier - // than actually checking and typecasting - if(D && D:unique_datum_id == uid) + if(D && D.unique_datum_id == uid) return D return null diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index 74591eb8070..c541e40768a 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -4,7 +4,7 @@ GLOBAL_DATUM(slmaster, /obj/effect/overlay) GLOBAL_VAR_INIT(CELLRATE, 0.002) // conversion ratio between a watt-tick and kilojoule GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) -// Announcer intercom, because too much stuff creates an intercom for one message then hard del()s it. +// Announcer intercom, because too much stuff creates an intercom for one message then qdel()s it. GLOBAL_DATUM_INIT(global_announcer, /obj/item/radio/intercom, create_global_announcer()) GLOBAL_DATUM_INIT(command_announcer, /obj/item/radio/intercom/command, create_command_announcer()) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index d348747fb80..083b347e52c 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -36,7 +36,7 @@ var/vote_no_default = 0 // vote does not default to nochange/norestart (tbi) var/vote_no_dead = 0 // dead people can't vote (tbi) // var/enable_authentication = 0 // goon authentication - var/del_new_on_log = 1 // del's new players if they log before they spawn in + var/del_new_on_log = 1 // qdel's new players if they log before they spawn in var/feature_object_spell_system = 0 //spawns a spellbook which gives object-type spells instead of verb-type spells for the wizard var/traitor_scaling = 0 //if amount of traitors scales based on amount of players var/protect_roles_from_antagonist = 0// If security and such can be tratior/cult/other diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 475bdaccb3c..6f8dd85b79b 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -407,7 +407,7 @@ SUBSYSTEM_DEF(ticker) EquipCustomItems(player) if(captainless) for(var/mob/M in GLOB.player_list) - if(!istype(M,/mob/new_player)) + if(!isnewplayer(M)) to_chat(M, "Captainship not forced on anyone.") /datum/controller/subsystem/ticker/proc/send_tip_of_the_round() diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index aed4a4c5c2d..ab5ff19462a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -50,6 +50,7 @@ loc.handle_atom_del(src) for(var/atom/movable/AM in contents) qdel(AM) + LAZYCLEARLIST(client_mobs_in_contents) loc = null if(pulledby) pulledby.stop_pulling() diff --git a/code/game/machinery/tcomms/_base.dm b/code/game/machinery/tcomms/_base.dm index 7e468a548bf..dc933099faa 100644 --- a/code/game/machinery/tcomms/_base.dm +++ b/code/game/machinery/tcomms/_base.dm @@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(tcomms_machines) if(is_admin(R) && !R.get_preference(CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. continue - if(istype(R, /mob/new_player)) // we don't want new players to hear messages. rare but generates runtimes. + if(isnewplayer(R)) // we don't want new players to hear messages. rare but generates runtimes. continue // --- Can understand the speech --- diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 14ccc103ab1..ab592cc0402 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -204,7 +204,7 @@ if(amount < 1) // Just in case a stack's amount ends up fractional somehow var/oldsrc = src - src = null //dont kill proc after del() + src = null //dont kill proc after qdel() usr.unEquip(oldsrc, 1) qdel(oldsrc) if(istype(O, /obj/item)) diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm index 2683e236269..95b11353b86 100644 --- a/code/game/verbs/who.dm +++ b/code/game/verbs/who.dm @@ -27,7 +27,7 @@ entry += " - Observing" else entry += " - DEAD" - else if(istype(C.mob, /mob/new_player)) + else if(isnewplayer(C.mob)) entry += " - New Player" else entry += " - DEAD" @@ -90,7 +90,7 @@ if(isobserver(C.mob)) msg += " - Observing" - else if(istype(C.mob,/mob/new_player)) + else if(isnewplayer(C.mob)) msg += " - Lobby" else msg += " - Playing" @@ -106,7 +106,7 @@ if(isobserver(C.mob)) modmsg += " - Observing" - else if(istype(C.mob,/mob/new_player)) + else if(isnewplayer(C.mob)) modmsg += " - Lobby" else modmsg += " - Playing" diff --git a/code/game/world.dm b/code/game/world.dm index daeab8fbe4c..355c6280aaf 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -232,7 +232,7 @@ GLOBAL_VAR_INIT(world_topic_spam_protect_time, world.timeofday) if(!C) return "No client with that name on server" - del(C) + qdel(C) return "Kick Successful" diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index 21b59586bfd..25693b58f47 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -146,7 +146,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = if(kickbannedckey) if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey) - del(banned_mob.client) + qdel(banned_mob.client) if(isjobban) jobban_client_fullban(ckey, job) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index df156c5b0df..1eed8083a97 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -72,7 +72,7 @@ GLOBAL_VAR_INIT(nologevent, 0) body += "\[[M.client.holder ? M.client.holder.rank : "Player"]\] " body += "\[" + M.client.get_exp_type(EXP_TYPE_CREW) + " as [EXP_TYPE_CREW]\]" - if(istype(M, /mob/new_player)) + if(isnewplayer(M)) body += " Hasn't Entered Game " else body += " \[Heal\] " @@ -147,7 +147,7 @@ GLOBAL_VAR_INIT(nologevent, 0) body += {" | Cryo "} if(M.client) - if(!istype(M, /mob/new_player)) + if(!isnewplayer(M)) body += "

" body += "Transformation:" body += "
" @@ -1004,13 +1004,13 @@ GLOBAL_VAR_INIT(gamma_ship_location, 1) // 0 = station , 1 = space /proc/kick_clients_in_lobby(message, kick_only_afk = 0) var/list/kicked_client_names = list() for(var/client/C in GLOB.clients) - if(istype(C.mob, /mob/new_player)) + if(isnewplayer(C.mob)) if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk continue if(message) to_chat(C, message) kicked_client_names.Add("[C.ckey]") - del(C) + qdel(C) return kicked_client_names //returns 1 to let the dragdrop code know we are trapping this event diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 4e3d2d65f30..80a60957c75 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -337,7 +337,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list( ghost.reenter_corpse() log_admin("[key_name(usr)] re-entered their body") feedback_add_details("admin_verb","P") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - else if(istype(mob,/mob/new_player)) + else if(isnewplayer(mob)) to_chat(src, "Error: Aghost: Can't admin-ghost whilst in the lobby. Join or observe first.") else //ghostize @@ -542,7 +542,7 @@ GLOBAL_LIST_INIT(admin_verbs_ticket, list( message_admins("[key_name_admin(src)] has warned [key_name_admin(C)] resulting in a [AUTOBANTIME] minute ban") log_admin("[key_name(src)] has warned [key_name(C)] resulting in a [AUTOBANTIME] minute ban") to_chat(C, "You have been autobanned due to a warning by [ckey].
This is a temporary ban, it will be removed in [AUTOBANTIME] minutes.") - del(C) + qdel(C) else message_admins("[key_name_admin(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban") log_admin("[key_name(src)] has warned [warned_ckey] resulting in a [AUTOBANTIME] minute ban") diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index efb5ac32f97..e89b829f421 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -268,7 +268,7 @@ else M_job = "Living" - else if(istype(M,/mob/new_player)) + else if(isnewplayer(M)) M_job = "New player" else if(isobserver(M)) @@ -356,7 +356,7 @@ dat += "[M.real_name]" else if(istype(M, /mob/living/silicon/pai)) dat += "pAI" - else if(istype(M, /mob/new_player)) + else if(isnewplayer(M)) dat += "New Player" else if(isobserver(M)) dat += "Ghost" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 1a040d46e90..ac8adc5fdf0 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -909,7 +909,7 @@ log_admin("[key_name(usr)] booted [key_name(M)].") message_admins("[key_name_admin(usr)] booted [key_name_admin(M)].", 1) //M.client = null - del(M.client) + qdel(M.client) //Player Notes else if(href_list["addnote"]) @@ -1011,8 +1011,7 @@ log_admin("[key_name(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") message_admins("[key_name_admin(usr)] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") - del(M.client) - //qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends. + qdel(M.client) if("No") var/reason = input(usr,"Please state the reason","Reason") as message|null if(!reason) @@ -1032,8 +1031,7 @@ feedback_inc("ban_perma",1) DB_ban_record(BANTYPE_PERMA, M, -1, reason) - del(M.client) - //qdel(M) + qdel(M.client) if("Cancel") return @@ -1507,7 +1505,7 @@ if(!check_rights(R_SPAWN)) return var/mob/M = locateUID(href_list["makeanimal"]) - if(istype(M, /mob/new_player)) + if(isnewplayer(M)) to_chat(usr, "This cannot be used on instances of type /mob/new_player") return if(alert(usr, "Confirm make animal?",, "Yes", "No") != "Yes") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 164d499e04a..dba9a5c26aa 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -19,7 +19,7 @@ var/list/client/targets[0] for(var/client/T) if(T.mob) - if(istype(T.mob, /mob/new_player)) + if(isnewplayer(T.mob)) targets["(New Player) - [T]"] = T else if(istype(T.mob, /mob/dead/observer)) targets["[T.mob.name](Ghost) - [T]"] = T @@ -42,7 +42,7 @@ var/list/client/targets[0] for(var/client/T) if(T.mob) - if(istype(T.mob, /mob/new_player)) + if(isnewplayer(T.mob)) targets["[T] - (New Player)"] = T else if(istype(T.mob, /mob/dead/observer)) targets["[T] - [T.mob.name](Ghost)"] = T diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 329efb8e067..496292c919b 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -251,7 +251,7 @@ GLOBAL_PROTECT(AdminProcCaller) alert("That mob doesn't seem to exist, close the panel and try again.") return - if(istype(M, /mob/new_player)) + if(isnewplayer(M)) alert("The mob must not be a new_player.") return @@ -382,7 +382,7 @@ GLOBAL_PROTECT(AdminProcCaller) if(!check_rights(R_DEBUG)) return - //This gets a confirmation check because it's way easier to accidentally hit this and delete things than it is with del-all + //This gets a confirmation check because it's way easier to accidentally hit this and delete things than it is with qdel-all var/confirm = alert("This will delete ALL Singularities and Tesla orbs except for any that are on away mission z-levels or the centcomm z-level. Are you sure you want to delete them?", "Confirm Panic Button", "Yes", "No") if(confirm != "Yes") return diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 3cd6458afdf..9a3a1215df3 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -59,10 +59,6 @@ var/karma = 0 var/karma_spent = 0 var/karma_tab = 0 - ///////////////////////////////////////////// - // /vg/: MEDIAAAAAAAA - // Set on login. - var/datum/media_manager/media = null var/topic_debugging = 0 //if set to true, allows client to see nanoUI errors -- yes i realize this is messy but it'll make live testing infinitely easier @@ -85,9 +81,6 @@ // If set to true, this client can interact with atoms such as buttons and doors on top of regular machinery interaction var/advanced_admin_interaction = FALSE - // Has the client been varedited by an admin? [Inherits from datum now] - // var/var_edited = FALSE - var/client_keysend_amount = 0 var/next_keysend_reset = 0 var/next_keysend_trip_reset = 0 diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 561b0b48149..c4604fcf9ab 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -432,7 +432,13 @@ ////////////// //DISCONNECT// ////////////// + /client/Del() + if(!gc_destroyed) + Destroy() //Clean up signals and timers. + return ..() + +/client/Destroy() if(holder) holder.owner = null GLOB.admins -= src @@ -442,7 +448,8 @@ movingmob.client_mobs_in_contents -= mob UNSETEMPTY(movingmob.client_mobs_in_contents) Master.UpdateTickRate() - return ..() + ..() //Even though we're going to be hard deleted there are still some things that want to know the destroy is happening + return QDEL_HINT_HARDDEL_NOW /client/proc/donator_check() @@ -556,7 +563,7 @@ if(GLOB.panic_bunker_enabled) var/threshold = config.panic_bunker_threshold src << "Server is not accepting connections from never-before-seen players until player count is less than [threshold]. Please try again later." - del(src) + qdel(src) return // Dont insert or they can just go in again var/DBQuery/query_insert = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[ckey]', Now(), Now(), '[sql_ip]', '[sql_computerid]', '[sql_admin_rank]')") diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm index 563ef98697d..a11ef107a8f 100644 --- a/code/modules/events/dust.dm +++ b/code/modules/events/dust.dm @@ -16,7 +16,7 @@ density = 1 anchored = 1 var/strength = 2 //ex_act severity number - var/life = 2 //how many things we hit before del(src) + var/life = 2 //how many things we hit before qdel(src) var/atom/goal = null /obj/effect/space_dust/weak diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index d6395bf3d43..4515a62d86b 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -115,7 +115,7 @@ //The reagents in the bottle splash all over the target, thanks for the idea Nodrak SplashReagents(target) - //Finally, smash the bottle. This kills (del) the bottle. + //Finally, smash the bottle. This kills (qdel) the bottle. smash(target, user) /obj/item/reagent_containers/food/drinks/bottle/proc/SplashReagents(mob/M) diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index 5f18a27adc9..99e0af0ca6a 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -135,7 +135,7 @@ if(message) for(var/mob/M in GLOB.player_list) - if(istype(M, /mob/new_player)) + if(isnewplayer(M)) continue if(check_rights(R_ADMIN|R_MOD, 0, M) && M.get_preference(CHAT_DEAD)) // Show the emote to admins/mods diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f10e2c88859..c98ca77a594 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -752,7 +752,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \ if(client.holder && (client.holder.rights & R_ADMIN)) is_admin = 1 - else if(stat != DEAD || istype(src, /mob/new_player)) + else if(stat != DEAD || isnewplayer(src)) to_chat(usr, "You must be observing to use this!") return diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 64444864804..37e116b4376 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -434,7 +434,7 @@ if(affecting) if(!affecting.buckled) affecting.pixel_x = 0 - affecting.pixel_y = 0 //used to be an animate, not quick enough for del'ing + affecting.pixel_y = 0 //used to be an animate, not quick enough for qdel'ing affecting.layer = initial(affecting.layer) affecting.grabbed_by -= src affecting = null diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 63175a68024..5fb5bcb06c8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -459,7 +459,7 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM name = realname for(var/mob/M in GLOB.player_list) - if(M.client && ((!istype(M, /mob/new_player) && M.stat == DEAD) || check_rights(R_ADMIN|R_MOD,0,M)) && M.get_preference(CHAT_DEAD)) + if(M.client && ((!isnewplayer(M) && M.stat == DEAD) || check_rights(R_ADMIN|R_MOD,0,M)) && M.get_preference(CHAT_DEAD)) var/follow var/lname if(subject) diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm index c3ec68c9793..1e704ea3449 100644 --- a/code/modules/mob/mob_transformation_simple.dm +++ b/code/modules/mob/mob_transformation_simple.dm @@ -4,7 +4,7 @@ //Note that this proc does NOT do MMI related stuff! /mob/proc/change_mob_type(var/new_type = null, var/turf/location = null, var/new_name = null as text, var/delete_old_mob = 0 as num, var/forcekey = 0) - if(istype(src,/mob/new_player)) + if(isnewplayer(src)) to_chat(usr, "cannot convert players who have not entered yet.") return diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index af3d439df59..9107d7d09ae 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -12,8 +12,13 @@ stat = 2 canmove = 0 -/mob/new_player/New() +/mob/new_player/Initialize(mapload) + SHOULD_CALL_PARENT(FALSE) + if(initialized) + stack_trace("Warning: [src]([type]) initialized multiple times!") + initialized = TRUE GLOB.mob_list += src + return INITIALIZE_HINT_NORMAL /mob/new_player/verb/new_player_panel() set src = usr