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
+1 -1
View File
@@ -33,7 +33,7 @@
// Fuck you asfaghewqWAFAWE
// See /singleton/recipe/proc/check_fruit(...) in recipe.dm for why
if(S.get_trait(TRAIT_FLESH_COLOUR))
if(GET_SEED_TRAIT(S, TRAIT_FLESH_COLOUR))
tags += "[ktag] slice"
tags += "dried [ktag] slice"
tags += "dried [ktag]"
+2 -2
View File
@@ -15,10 +15,10 @@ while simultaneously growing faster from being within its preferences.
for(var/seed_name in SSplants.seeds)
var/datum/seed/S = SSplants.seeds[seed_name]
if(S.get_trait(TRAIT_LIGHT_TOLERANCE) < S.get_trait(TRAIT_LIGHT_PREFERENCE))
if(GET_SEED_TRAIT(S, TRAIT_LIGHT_TOLERANCE) < GET_SEED_TRAIT(S, TRAIT_LIGHT_PREFERENCE))
TEST_FAIL("Seed [S] has a light preference value set higher than its light tolerance.")
if(S.get_trait(TRAIT_HEAT_TOLERANCE) < S.get_trait(TRAIT_HEAT_PREFERENCE))
if(GET_SEED_TRAIT(S, TRAIT_HEAT_TOLERANCE) < GET_SEED_TRAIT(S, TRAIT_HEAT_PREFERENCE))
TEST_FAIL("Seed [S] has a heat preference value set higher than its heat tolerance.")
if(!reported)