Skip to content

Commit

Permalink
Fixes glowshroom runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskog committed Jul 9, 2020
1 parent 4a9d8dd commit 7f8a331
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/game/objects/effects/glowshroom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
var/delay_spread = 2 MINUTES
/// Time interval between glowshroom decay checks
var/delay_decay = 30 SECONDS
/// Keeps track of timers for when we inevitably get deleted.
var/list/timers = list("spread", "decay")
/// Boolean to indicate if the shroom is on the floor/wall
var/floor = 0
/// Mushroom generation number
Expand Down Expand Up @@ -46,8 +48,8 @@
. += "This is a [generation]\th generation [name]!"

/obj/structure/glowshroom/Destroy()
if(myseed)
QDEL_NULL(myseed)
deltimer(timers["spread"])
deltimer(timers["decay"])
return ..()

/**
Expand Down Expand Up @@ -142,6 +144,8 @@
continue

Decay(TRUE, 2) // Decay before spawning new mushrooms to reduce their endurance
if(QDELETED(src)) //Decay can end us
return
var/obj/structure/glowshroom/child = new type(newLoc, myseed, TRUE, TRUE)
child.generation = generation + 1
shrooms_planted++
Expand Down

0 comments on commit 7f8a331

Please sign in to comment.