mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user