valid_subtypes proc (#93541)

## About The Pull Request
discussed in #93439, a generic proc for getting a list of all types
minus abstract types.
applies this to most instances of a for loop that currently filters out
abstract types

it SHOULD be a nothing burger for performance, however I have not bench
marked the difference. (also testing, there is a total of 7 calls in
init to it)
This commit is contained in:
FalloutFalcon
2025-10-28 12:49:18 -05:00
committed by GitHub
parent 2a904c2399
commit 060d4a65ba
16 changed files with 41 additions and 46 deletions
@@ -23,14 +23,14 @@
continue
add_growth_component(path)
return
var/list/valid_subtypes = list()
var/list/valid_subtypesof = list()
var/static/list/all_subtypes = subtypesof(/mob/living/basic/raptor/baby_raptor)
for(var/path in all_subtypes)
var/mob/living/basic/raptor/baby_raptor/raptor_path = path
if(!prob(initial(raptor_path.roll_rate)))
continue
valid_subtypes += raptor_path
add_growth_component(pick(valid_subtypes))
valid_subtypesof += raptor_path
add_growth_component(pick(valid_subtypesof))
/obj/item/food/egg/raptor_egg/proc/add_growth_component(growth_path)
if(length(GLOB.raptor_population) >= MAX_RAPTOR_POP)