Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize and GC failure fixes #1 #13190

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/objects/effects/decals/Cleanable/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
var/list/viruses = list()

/obj/effect/decal/cleanable/vomit/Initialize()
..()
. = ..()
create_reagents(20, src)

/obj/effect/decal/cleanable/tomato_smudge
Expand Down
13 changes: 5 additions & 8 deletions code/game/objects/items/glassjar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,22 @@

/obj/item/glass_jar/gumball
contains = JAR_GUMBALL
var/gumball_path = /obj/item/clothing/mask/chewable/candy/gum/gumball

/obj/item/glass_jar/gumball/medical
gumball_path = /obj/item/clothing/mask/chewable/candy/gum/gumball/medical

/obj/item/glass_jar/gumball/Initialize()
..()
for(var/i = 1 to GUMBALL_MAX)
var/obj/item/clothing/mask/chewable/candy/gum/gumball/G = new(src)
var/obj/item/clothing/mask/chewable/candy/gum/gumball/G = new gumball_path(src)
contained += G

return INITIALIZE_HINT_LATELOAD

/obj/item/glass_jar/gumball/LateInitialize()
update_icon()

/obj/item/glass_jar/gumball/medical/Initialize()
for(var/i = 1 to GUMBALL_MAX)
var/obj/item/clothing/mask/chewable/candy/gum/gumball/medical/G = new(src)
contained += G

return INITIALIZE_HINT_LATELOAD

#undef JAR_NOTHING
#undef JAR_MONEY
#undef JAR_ANIMAL
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/janicart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var/mob/living/pulling

/obj/structure/janitorialcart/full/Initialize()
..()
. = ..()
mybag = new /obj/item/storage/bag/trash(src)
mymop = new /obj/item/mop(src)
myspray = new /obj/item/reagent_containers/spray/cleaner(src)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@
slowdown = 0

/obj/structure/bed/roller/Initialize()
..()
. = ..()
LAZYADD(can_buckle, /obj/structure/closet/body_bag)

/obj/structure/bed/roller/Destroy()
Expand Down
6 changes: 6 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
changing_turf = FALSE
turfs -= src

remove_cleanables()
cleanup_roof()

if (ao_queued)
Expand Down Expand Up @@ -524,3 +525,8 @@ var/const/enterloopsanity = 100

/turf/proc/is_floor()
return FALSE

/turf/proc/remove_cleanables()
for(var/obj/effect/O in src)
if(istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable))
qdel(O)
4 changes: 4 additions & 0 deletions code/modules/assembly/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
listening_objects += src

/obj/item/device/assembly_holder/Destroy()
if(a_left)
a_left.holder = null
if(a_right)
a_right.holder = null
listening_objects -= src
return ..()

Expand Down
10 changes: 2 additions & 8 deletions code/modules/detectivework/tools/sample_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
var/label_text = ""

/obj/item/sample/Initialize(var/newloc, var/atom/supplied)
..(newloc)
. = ..(newloc)
if(supplied)
copy_evidence(supplied)
name = "[initial(name)] ([supplied.get_swab_name()])"
LAZYADD(source, supplied.get_swab_name())

/obj/item/sample/print/Initialize(var/newloc, var/atom/supplied)
..(newloc, supplied)
. = ..(newloc, supplied)
if(LAZYLEN(evidence))
icon_state = "fingerprint1"

Expand Down Expand Up @@ -68,12 +68,6 @@
else
name = "[initial(name)] ([label_text])"

/obj/item/sample/Initialize(var/newloc, var/atom/supplied)
..(newloc)
if(supplied)
copy_evidence(supplied)
name = "[initial(name)] ([supplied.get_swab_name()])"
LAZYADD(source, supplied.get_swab_name())

/atom/proc/get_swab_name()
return "\the [initial(name)]"
Expand Down
4 changes: 2 additions & 2 deletions code/modules/heavy_vehicle/premade/_premade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
..()

/mob/living/heavy_vehicle/premade/random/boring/Initialize(mapload, var/obj/structure/heavy_vehicle_frame/source_frame)
..(mapload, source_frame, using_boring_colours = TRUE)
. = ..(mapload, source_frame, using_boring_colours = TRUE)

/mob/living/heavy_vehicle/premade/random/extra/Initialize(mapload, var/obj/structure/heavy_vehicle_frame/source_frame)
..(mapload, source_frame, super_random = TRUE)
. = ..(mapload, source_frame, super_random = TRUE)
2 changes: 1 addition & 1 deletion code/modules/mining/mine_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
anchored = TRUE

/obj/item/stack/flag/red/planted/Initialize()
..()
. = ..()
base_state = "redflag"
set_light(2)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/abstract/new_player/menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
announce_ghost_joinleave(src)
var/mob/living/carbon/human/dummy/mannequin/mannequin = new
client.prefs.dress_preview_mob(mannequin)
observer.appearance = mannequin
observer.appearance = mannequin.appearance
observer.appearance_flags = KEEP_TOGETHER
observer.alpha = 127
observer.layer = initial(observer.layer)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,12 @@
. =..()
if(!.)
return
if(!stat && prob(3) && eggsleft > 0)
if(!stat && prob(3) && eggsleft > 0 && chicken_count < MAX_CHICKENS)
visible_message("[src] [pick("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.")]")
eggsleft--
var/obj/item/reagent_containers/food/snacks/egg/E = new(get_turf(src))
E.pixel_x = rand(-6,6)
E.pixel_y = rand(-6,6)
if(chicken_count < MAX_CHICKENS && prob(10))
START_PROCESSING(SSprocessing, E)

// Penguins

Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,16 @@

pointing_effect = new /obj/effect/decal/point(tile)
pointing_effect.invisibility = invisibility
addtimer(CALLBACK(GLOBAL_PROC, /proc/qdel, pointing_effect), 2 SECONDS)
addtimer(CALLBACK(.proc/end_pointing_effect), 2 SECONDS)

face_atom(A)
return 1

/mob/proc/end_pointing_effect()
if(pointing_effect)
qdel(pointing_effect)
pointing_effect = null

/mob/verb/mode()
set name = "Activate Held Object"
set category = "Object"
Expand Down