@@ -1305,8 +1305,15 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/foodpreserver)
13051305 var /minimum_pop = 0
13061306 // / The payload is executed if the configured job's roundstart amount is less than this
13071307 var /minimum_job_amount = 0
1308- // / The job datum type
1309- var /targeted_job_type = null
1308+ // / A list of job datum types to compare [minimum_job_amount] against
1309+ var /list /targeted_job_types = null
1310+ /* *
1311+ * It's highly likely that there will be several lowpop mapping helpers with an identical configuration.
1312+ *
1313+ * To avoid repeated checks, we generate a unique identifier for this mapping helper's configuration and store
1314+ * whether or not it passed in a static associative list formatted as: [check identifier --> TRUE/FALSE].
1315+ */
1316+ VAR_PROTECTED / static / list / cached_succeeded_checks = list ()
13101317
13111318/ obj / effect/ mapping_helpers/ lowpop/ Initialize(mapload)
13121319 . = .. ()
@@ -1325,29 +1332,32 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/foodpreserver)
13251332/ obj / effect/ mapping_helpers/ lowpop/ proc / on_round_start()
13261333 SIGNAL_HANDLER
13271334
1328- var /static /list /cached_succeeded_checks = list ()
1329- var /cached_check_identifier = " [ targeted_job_type] ; [ minimum_job_amount] ; [ minimum_pop] "
1335+ var /cached_check_identifier = " [ targeted_job_types. Join(" ," )] ; [ minimum_job_amount] ; [ minimum_pop] "
13301336 if (! isnull(cached_succeeded_checks[cached_check_identifier]))
13311337 if (cached_succeeded_checks[cached_check_identifier])
13321338 payload ()
1333- qdel (src )
1334- return
1335-
1336- if (length(GLOB . manifest. general) < minimum_pop || (ispath(targeted_job_type) && SSjob. get_job_type(targeted_job_type)?. current_positions < minimum_job_amount))
1337- cached_succeeded_checks[cached_check_identifier] = TRUE
1338- payload ()
13391339 else
1340- cached_succeeded_checks[cached_check_identifier] = FALSE
1340+ var /amount_of_specified_jobs = 0
1341+ for (var /job_type in targeted_job_types)
1342+ amount_of_specified_jobs += SSjob. get_job_type(job_type)?. current_positions
1343+
1344+ if (length(GLOB . manifest. general) < minimum_pop || amount_of_specified_jobs < minimum_job_amount)
1345+ cached_succeeded_checks[cached_check_identifier] = TRUE
1346+ payload ()
1347+ else
1348+ cached_succeeded_checks[cached_check_identifier] = FALSE
1349+
13411350 qdel (src )
13421351
13431352/ obj / effect/ mapping_helpers/ lowpop/ proc / payload()
1353+ SHOULD_NOT_SLEEP (TRUE )
13441354 return
13451355
13461356/ obj / effect/ mapping_helpers/ lowpop/ cable_spawner
13471357 name = " lowpop cable spawner"
13481358 icon_state = " lowpop_cable"
13491359 minimum_job_amount = 1
1350- targeted_job_type = / datum / job/ station_engineer
1360+ targeted_job_types = list ( / datum / job/ station_engineer, / datum / job / chief_engineer)
13511361
13521362 // / The type of cable to spawn
13531363 var /cable_type = / obj / structure/ cable
@@ -1362,7 +1372,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/foodpreserver)
13621372 name = " lowpop solar console enabler"
13631373 icon_state = " lowpop_solar"
13641374 minimum_job_amount = 1
1365- targeted_job_type = / datum / job/ station_engineer
1375+ targeted_job_types = list ( / datum / job/ station_engineer, / datum / job / chief_engineer)
13661376
13671377/ obj / effect/ mapping_helpers/ lowpop/ solar_console/ register_signal()
13681378 RegisterSignal (SSdcs, COMSIG_GLOB_POST_START , PROC_REF (on_round_start))
0 commit comments