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
+6 -6
View File
@@ -137,12 +137,12 @@ SUBSYSTEM_DEF(plants)
if(seed.chems && !isnull(seed.chems[/singleton/reagent/acid/polyacid]))
seed.chems[/singleton/reagent/acid/polyacid] = null // Eating through the hull will make these plants completely inviable, albeit very dangerous.
seed.chems -= null // Setting to null does not actually remove the entry, which is weird.
seed.set_trait(TRAIT_IDEAL_HEAT,293)
seed.set_trait(TRAIT_HEAT_TOLERANCE,20)
seed.set_trait(TRAIT_IDEAL_LIGHT,8)
seed.set_trait(TRAIT_LIGHT_TOLERANCE,5)
seed.set_trait(TRAIT_LOWKPA_TOLERANCE,25)
seed.set_trait(TRAIT_HIGHKPA_TOLERANCE,200)
SET_SEED_TRAIT(seed, TRAIT_IDEAL_HEAT, 293)
SET_SEED_TRAIT(seed, TRAIT_HEAT_TOLERANCE, 20)
SET_SEED_TRAIT(seed, TRAIT_IDEAL_LIGHT, 8)
SET_SEED_TRAIT(seed, TRAIT_LIGHT_TOLERANCE, 5)
SET_SEED_TRAIT(seed, TRAIT_LOWKPA_TOLERANCE, 25)
SET_SEED_TRAIT(seed, TRAIT_HIGHKPA_TOLERANCE, 200)
return seed
/// Debug for testing seed genes.