The road to Initialize() stability - Enforcing parent call on New(), Initialize() and Destroy() (#14719)

* The road to Initialize() stability

* Fixes sanity, for now
This commit is contained in:
AffectedArc07
2020-10-28 12:35:36 -04:00
committed by GitHub
parent 997f527f3a
commit 2c37ae8fd0
50 changed files with 102 additions and 59 deletions
+1
View File
@@ -27,6 +27,7 @@ GLOBAL_VAR_INIT(intercom_range_display_status, 0)
icon_state = "25percent"
/obj/effect/debugging/camera_range/New()
. = ..()
src.pixel_x = -224
src.pixel_y = -224
@@ -133,6 +133,7 @@
var/obj/machinery/computer/mob_battle_terminal/my_terminal
/obj/effect/nanomob/battle/New(loc, datum/mob_hunt/new_info)
. = ..()
if(new_info)
mob_info = new_info
update_self()
@@ -12,6 +12,7 @@
var/water_timer = 0
/obj/effect/waterfall/New()
. = ..()
water_timer = addtimer(CALLBACK(src, .proc/drip), water_frequency, TIMER_STOPPABLE)
/obj/effect/waterfall/Destroy()
@@ -47,6 +47,7 @@
name = "Safecode hint spawner"
/obj/effect/landmark/sc_bible_spawner/New()
. = ..()
var/obj/item/storage/bible/B = new /obj/item/storage/bible/booze(src.loc)
B.name = "The Holy book of the Geometer"
B.deity_name = "Narsie"
@@ -135,9 +135,6 @@
var/triggerproc = "triggerrad1" //name of the proc thats called when the mine is triggered
var/triggered = 0
/obj/effect/meatgrinder/New()
icon_state = "blobpod"
/obj/effect/meatgrinder/Crossed(AM as mob|obj, oldloc)
Bumped(AM)
+1
View File
@@ -3,6 +3,7 @@
var/client/cl
/obj/effect/buildmode_line/New(client/C, atom/atom_a, atom/atom_b, linename)
. = ..()
name = linename
loc = get_turf(atom_a)
I = image('icons/misc/mark.dmi', src, "line", 19.0)
+1
View File
@@ -182,6 +182,7 @@
slot_flags = SLOT_EARS | SLOT_TWOEARS
/obj/item/clothing/ears/offear/New(var/obj/O)
. = ..()
name = O.name
desc = O.desc
icon = O.icon
+1
View File
@@ -95,6 +95,7 @@
var/suits = list("red", "green", "ntblue", "purple", "yellow", "ltblue")
/obj/effect/nasavoidsuitspawner/New()
. = ..()
var/obj/item/clothing/head/helmet/space/nasavoid/H
var/obj/item/clothing/suit/space/nasavoid/S
switch(pick(suits))
+1
View File
@@ -32,6 +32,7 @@
life = 40
/obj/effect/space_dust/New()
. = ..()
var/startx = 0
var/starty = 0
var/endy = 0
+1
View File
@@ -33,6 +33,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
var/move_delay = 1
/obj/effect/immovablerod/New(atom/start, atom/end, delay)
. = ..()
loc = start
z_original = z
destination = end
+7
View File
@@ -200,6 +200,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
var/obj/effect/hallucination/simple/xeno/xeno = null
/obj/effect/hallucination/xeno_attack/New(loc, mob/living/carbon/T)
. = ..()
target = T
for(var/obj/machinery/atmospherics/unary/vent_pump/U in orange(7,target))
if(!U.welded)
@@ -340,6 +341,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
var/obj/effect/hallucination/simple/singularity/s = null
/obj/effect/hallucination/singularity_scare/New(loc, mob/living/carbon/T)
. = ..()
target = T
var/turf/start = get_turf(T)
var/screen_border = pick(GLOB.cardinal)
@@ -370,6 +372,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
/obj/effect/hallucination/battle
/obj/effect/hallucination/battle/New(loc, mob/living/carbon/T)
. = ..()
target = T
var/hits = rand(2,5)
switch(rand(1,5))
@@ -459,6 +462,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
var/list/image/delusions = list()
/obj/effect/hallucination/delusion/New(loc, mob/living/carbon/T, force_kind = null, duration = 300,skip_nearby = 1, custom_icon = null, custom_icon_file = null)
. = ..()
target = T
var/image/A = null
var/kind = force_kind ? force_kind : pick("clown", "corgi", "carp", "skeleton", "demon","zombie")
@@ -707,6 +711,7 @@ GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/gun/projectile, /obj/ite
var/list/doors = list()
/obj/effect/hallucination/bolts/New(loc, mob/living/carbon/T, door_number = -1) //-1 for sever 1-2 for subtle
. = ..()
target = T
var/image/I = null
var/count = 0
@@ -731,6 +736,7 @@ GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/gun/projectile, /obj/ite
/obj/effect/hallucination/whispers
/obj/effect/hallucination/whispers/New(loc,var/mob/living/carbon/T)
. = ..()
target = T
var/speak_messages = list("I'm watching you...","[target.name]!","Get out!","Kchck-Chkck? Kchchck!","Did you hear that?","What did you do ?","Why?","Give me that!","Honk!","HELP!!", "EI NATH!!", "RUN!!", "Kill me!","O bidai nabora se'sma!")
var/radio_messages = list("Xenos!","Singularity loose!","Comms down!","They are arming the nuke!","They butchered Ian!","H-help!","[pick("Cult", "Wizard", "Ling", "Ops", "Revenant", "Murderer", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]","Where's [target.name]?","Call the shuttle!","AI rogue!!")
@@ -766,6 +772,7 @@ GLOBAL_LIST_INIT(non_fakeattack_weapons, list(/obj/item/gun/projectile, /obj/ite
/obj/effect/hallucination/message
/obj/effect/hallucination/message/New(loc,var/mob/living/carbon/T)
. = ..()
target = T
var/chosen = pick("<span class='userdanger'>The light burns you!</span>",
"<span class='danger'>You don't feel like yourself.</span>",
@@ -23,6 +23,7 @@
var/bottling = 0
/obj/machinery/bottler/New()
. = ..()
if(!available_recipes)
available_recipes = list()
acceptable_items = list()
@@ -31,6 +31,7 @@
)
/obj/machinery/juicer/New()
. = ..()
beaker = new /obj/item/reagent_containers/glass/beaker/large(src)
/obj/machinery/juicer/update_icon()
@@ -8,5 +8,6 @@
/obj/item/honey_frame/New()
. = ..()
pixel_x = rand(8,-8)
pixel_y = rand(8,-8)
@@ -77,7 +77,8 @@
/obj/machinery/anomalous_crystal/ex_act()
ActivationReaction(null,"bomb")
/obj/machinery/anomalous_crystal/random/New()//Just a random crysal spawner for loot
/obj/machinery/anomalous_crystal/random/New() //Just a random crysal spawner for loot
. = ..()
var/random_crystal = pick(typesof(/obj/machinery/anomalous_crystal) - /obj/machinery/anomalous_crystal/random - /obj/machinery/anomalous_crystal)
new random_crystal(loc)
qdel(src)
@@ -6,12 +6,6 @@
canmove = 0
a_intent = INTENT_HARM // This is apparently the only thing that stops other mobs walking through them as if they were thin air.
/mob/living/silicon/decoy/New()
src.icon = 'icons/mob/ai.dmi'
src.icon_state = "ai"
src.anchored = 1
src.canmove = 0
/mob/living/silicon/decoy/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/aicard))
to_chat(user, "<span class='warning'>You cannot find an intellicard slot on [src].</span>")
+7 -4
View File
@@ -39,15 +39,18 @@
/mob/living/silicon/New()
GLOB.silicon_mob_list |= src
..()
var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
add_language("Galactic Common")
init_subsystems()
RegisterSignal(SSalarm, COMSIG_TRIGGERED_ALARM, .proc/alarm_triggered)
RegisterSignal(SSalarm, COMSIG_CANCELLED_ALARM, .proc/alarm_cancelled)
/mob/living/silicon/Initialize()
. = ..()
var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC]
diag_hud.add_to_hud(src)
diag_hud_set_status()
diag_hud_set_health()
/mob/living/silicon/med_hud_set_health()
return //we use a different hud
+1
View File
@@ -121,6 +121,7 @@
/datum/feed_channel/Destroy()
for(var/m in messages)
GLOB.news_network.stories -= m
return ..()
/**
* Returns whether the given user can publish new stories to this channel.
+2
View File
@@ -16,10 +16,12 @@
var/screen = 0
/obj/item/paper_bundle/New(default_papers = TRUE)
. = ..()
if(default_papers) // This is to avoid runtime occuring from a paper bundle being created without a paper in it.
new /obj/item/paper(src)
new /obj/item/paper(src)
amount += 1
/obj/item/paper_bundle/attackby(obj/item/W as obj, mob/user as mob, params)
..()
var/obj/item/paper/P
@@ -195,6 +195,7 @@
harmful = FALSE
/obj/item/ammo_casing/energy/wormhole/New(var/obj/item/gun/energy/wormhole_projector/wh)
. = ..()
gun = wh
/obj/item/ammo_casing/energy/wormhole/orange
+1
View File
@@ -294,4 +294,5 @@
density = 0
/obj/effect/syringe_gun_dummy/New()
. = ..()
create_reagents(15)
@@ -214,6 +214,7 @@
color = "#FF6600"
/obj/item/projectile/beam/wormhole/New(var/obj/item/ammo_casing/energy/wormhole/casing)
. = ..()
if(casing)
gun = casing.gun
+1
View File
@@ -223,6 +223,7 @@ GLOBAL_DATUM(blackbox, /obj/machinery/blackbox_recorder)
//Only one can exsist in the world!
/obj/machinery/blackbox_recorder/New()
SHOULD_CALL_PARENT(FALSE) // TODO: I still need to shoot this
if(GLOB.blackbox)
if(istype(GLOB.blackbox,/obj/machinery/blackbox_recorder))
qdel(src)
@@ -203,6 +203,7 @@
log_debug("Multiple nodes left behind after SW grid qdel: [available_nodes.len]")
for(var/datum/point/P in available_nodes)
log_debug("([P.x],[P.y])")
return ..()
/datum/spacewalk_grid/proc/add_available_node(datum/point/P)
var/hash = P.hash()