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

Glowshrooms runtime when disappearing #52099

Closed
Angustmeta opened this issue Jul 8, 2020 · 4 comments · Fixed by #52120
Closed

Glowshrooms runtime when disappearing #52099

Angustmeta opened this issue Jul 8, 2020 · 4 comments · Fixed by #52120
Labels
Bug Correct Functionality

Comments

@Angustmeta
Copy link
Contributor

Local testing.

Reproduction:

  • Spawn glowshroom.
  • Varedit its seed's production stat to 10 so it grows as fast as possible (because of Glowshroom spread speed is reversed #52076).
  • Plant it and wait like 6 minutes until mushrooms start disappearing from old age.

Runtime in glowshroom.dm,110: Cannot read null.potency
proc name: Spread (/obj/structure/glowshroom/proc/Spread)
usr: Angust/(Gus Banner)
usr.loc: (Bar (127,136,2))
src: the glowshroom (/obj/structure/glowshroom)
src.loc: null
call stack:
the glowshroom (/obj/structure/glowshroom): Spread()
/datum/callback (/datum/callback): Invoke()
world: PushUsr(Gus Banner (/mob/living/carbon/human), /datum/callback (/datum/callback))
/datum/callback (/datum/callback): InvokeAsync()
Timer (/datum/controller/subsystem/timer): fire(0)
Timer (/datum/controller/subsystem/timer): ignite(0)
Master (/datum/controller/master): RunQueue()
Master (/datum/controller/master): Loop()
Master (/datum/controller/master): StartProcessing(0)

var/chance_stats = ((myseed.potency + myseed.endurance * 2) * 0.2) // Chance of generating a new mushroom based on stats

and

Runtime in glowshroom.dm,150: Cannot read null.yield
proc name: Spread (/obj/structure/glowshroom/proc/Spread)
usr: Angust/(Gus Banner)
usr.loc: (Bar (127,136,2))
src: the glowshroom (/obj/structure/glowshroom)
src.loc: null
call stack:
the glowshroom (/obj/structure/glowshroom): Spread()
/datum/callback (/datum/callback): Invoke()
world: PushUsr(Gus Banner (/mob/living/carbon/human), /datum/callback (/datum/callback))
/datum/callback (/datum/callback): InvokeAsync()
Timer (/datum/controller/subsystem/timer): fire(0)
Timer (/datum/controller/subsystem/timer): ignite(0)
Master (/datum/controller/master): RunQueue()
Master (/datum/controller/master): Loop()
Master (/datum/controller/master): StartProcessing(0)

if(shrooms_planted <= myseed.yield) //if we didn't get all possible shrooms planted, try again later

I'm planning to PR a fix for #52076 but I have no idea how to fix these unrelated runtimes. If it's super simple I'd gladly fix them at the same time but otherwise I'll just ignore them.

@kriskog
Copy link
Contributor

kriskog commented Jul 8, 2020

Its trying to read off a deleted seed. When they make a new shroom patch, a reference to the planting seed is passed along, but when any shroom is deleted so is the seed. All the remaining shrooms now have a null seed. We could probably just not delete the seed here and hope GC takes care of it?

/obj/structure/glowshroom/Destroy()
	if(myseed)
		QDEL_NULL(myseed)
	return ..()

@Angustmeta
Copy link
Contributor Author

Okay. First test I tried to simply remove the middle two lines:

[22:02:50] Runtime in unsorted.dm,1129: addtimer called with a callback assigned to a qdeleted object. In the future such timers will not be supported and may refuse to run or run with a 0 wait
  proc name: stack trace (/proc/stack_trace)
  usr.loc: (Central Primary Hallway (139,154,2))
  src: null
  call stack:
  stack trace("addtimer called with a callbac...")
  addtimer(/datum/callback (/datum/callback), 200, 0)
  the glowcap (/obj/structure/glowshroom/glowcap): Spread()

@Fikou Fikou added the Bug Correct Functionality label Jul 8, 2020
@kriskog
Copy link
Contributor

kriskog commented Jul 9, 2020

Thats an unrelated issue. Basically, spread is run on a timer that isnt stopped when its decayed and deleted.

If you are removing the seed deletion, remove the entire proc as it now only serves to return parent which it does automagically.

@Angustmeta
Copy link
Contributor Author

Alright. I tried removing the whole

/obj/structure/glowshroom/Destroy()
   if(myseed)
		QDEL_NULL(myseed)
	return ..()

It does remove the two runtimes described in this issue. Now to figure out how to get rid of the

Runtime in unsorted.dm,1129: addtimer called

because it's throwing them like crazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Correct Functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants