[MIRROR] filled trashcarts spawn nearby grime when initialized instead of when opened for the first time [MDB IGNORE] (#19550)

* filled trashcarts spawn nearby grime when initialized instead of when opened for the first time (#73608)

## About The Pull Request
Filled trashcarts spawn some trash in them once they are opened for the
first time. But they also spawn grime, and the problem with that is that
grime spawns in a range around the trashcart. So opening the trashcart
for the first time would cause the grime to suddenly pop in around the
cart.

This PR changes it so that the grime is spawned when the filled
trashcart is initialized.
## Why It's Good For The Game
Having trash spawn around the trashcart the moment that you open it is
probably not intended. The grime is probably meant to be there before
the trashcart is opened for the first time.
## Changelog
🆑
fix: filled trashcarts spawn nearby grime when initialized instead of
when opened for the first time
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>

* filled trashcarts spawn nearby grime when initialized instead of when opened for the first time

---------

Co-authored-by: kawoppi <94711066+kawoppi@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-02-26 21:22:15 +01:00
committed by GitHub
parent d097050d1d
commit 1c524fa584

View File

@@ -138,13 +138,17 @@
/obj/structure/closet/crate/trashcart/filled
/obj/structure/closet/crate/trashcart/filled/Initialize(mapload)
. = ..()
if(mapload)
new /obj/effect/spawner/random/trash/grime(loc) //needs to be done before the trashcart is opened because it spawns things in a range outside of the trashcart
/obj/structure/closet/crate/trashcart/filled/PopulateContents()
. = ..()
for(var/i in 1 to rand(7,15))
new /obj/effect/spawner/random/trash/garbage(src)
if(prob(12))
new /obj/item/storage/bag/trash/filled(src)
new /obj/effect/spawner/random/trash/grime(loc)
/obj/structure/closet/crate/internals
desc = "An internals crate."