Turn hydroponics get and set_trait into defines (#21404)

Hydroponics tray processing is a massive chunk of machinery processing
for no good reason, I have a sneaking suspicion that this is due to proc
overhead on get_trait, as process can call it upwards of 30 times per
tick per tray.

Realistically most of the things that are traits should instead be
variables, but that's a refactor for someone with more time.
This commit is contained in:
Wildkins
2025-09-28 12:09:49 +00:00
committed by GitHub
parent 63fb270cfe
commit 290032afc7
39 changed files with 1349 additions and 1343 deletions
+3 -3
View File
@@ -232,7 +232,7 @@
/datum/effect/effect/system/smoke_spread/chem/spores/start()
..()
if(seed && seed.get_trait(TRAIT_SPREAD))
if(seed && GET_SEED_TRAIT(seed, TRAIT_SPREAD))
var/sporecount = 0
for(var/turf/T in targetTurfs)
var/bad_turf = 0
@@ -242,10 +242,10 @@
break
if(bad_turf)
continue
if(prob(min(seed.get_trait(TRAIT_POTENCY), 50)))
if(prob(min(GET_SEED_TRAIT(seed, TRAIT_POTENCY), 50)))
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(T,seed)
sporecount++
if(sporecount < max(1, round(seed.get_trait(TRAIT_POTENCY) / 20), 1))
if(sporecount < max(1, round(GET_SEED_TRAIT(seed, TRAIT_POTENCY) / 20), 1))
break