Fixes Runtime in chemsmoke.dm,177: Cannot read null.seed_name

- This was caused by create_spores() being called on seeds which were not registered with the plant_controller (becuase they had never been harvested)
- Instead of registering them, we can just pass the seed datum itself, that is all the chemsmoke needs anyway.
This commit is contained in:
Leshana
2020-03-30 19:21:34 -04:00
parent 7f18d508ea
commit 75d9bee4a0
2 changed files with 5 additions and 6 deletions
+4 -5
View File
@@ -29,11 +29,10 @@
show_log = 0
var/datum/seed/seed
/datum/effect/effect/system/smoke_spread/chem/spores/New(seed_name)
if(seed_name && plant_controller)
seed = plant_controller.seeds[seed_name]
if(!seed)
qdel(src)
/datum/effect/effect/system/smoke_spread/chem/spores/New(_seed)
seed = _seed
if(!istype(seed))
CRASH("Invalid seed datum passed! [seed] ([seed?.type])")
..()
/datum/effect/effect/system/smoke_spread/chem/New()
+1 -1
View File
@@ -104,7 +104,7 @@
var/injecting = min(5,max(1,get_trait(TRAIT_POTENCY)/3))
R.add_reagent(rid,injecting)
var/datum/effect/effect/system/smoke_spread/chem/spores/S = new(name)
var/datum/effect/effect/system/smoke_spread/chem/spores/S = new(src)
S.attach(T)
S.set_up(R, round(get_trait(TRAIT_POTENCY)/4), 0, T)
S.start()