@@ -135,8 +135,8 @@ GLOBAL_LIST_INIT(job_display_order, list(
135
135
// / Should this job be allowed to be picked for the bureaucratic error event?
136
136
var /allow_bureaucratic_error = TRUE
137
137
138
- // /Is this job affected by weird spawns like the ones from station traits
139
- var /random_spawns_possible = TRUE
138
+ // / How this job decides where to spawn.
139
+ var /spawn_logic = JOBSPAWN_ALLOW_RANDOM
140
140
141
141
// / List of family heirlooms this job can get with the family heirloom quirk. List of types.
142
142
var /list /family_heirlooms
@@ -433,22 +433,45 @@ GLOBAL_LIST_INIT(job_display_order, list(
433
433
return " Due to extreme staffing shortages, newly promoted Acting Captain [ captain. real_name] on deck!"
434
434
435
435
436
- // / Returns either an atom the mob should spawn in, or null, if we have no special overrides .
436
+ // / Returns either an atom the mob should spawn on .
437
437
/ datum / job/ proc / get_roundstart_spawn_point()
438
- if (random_spawns_possible)
439
- return get_latejoin_spawn_point()
438
+ SHOULD_NOT_OVERRIDE (TRUE )
440
439
441
- if (length(GLOB . high_priority_spawns[title]))
442
- return pick (GLOB . high_priority_spawns[title])
440
+ if (spawn_logic == JOBSPAWN_FORCE_RANDOM )
441
+ return get_roundstart_spawn_point_random()
442
+
443
+ var /atom /spawn_point = get_roundstart_spawn_point_fixed()
444
+ if (isnull(spawn_point))
445
+ // That's okay, the map may not have any fixed spawnpoints for this job and this job allows that.
446
+ if (spawn_logic == JOBSPAWN_ALLOW_RANDOM )
447
+ return get_roundstart_spawn_point_random()
448
+
449
+ else // Something has gone horribly wrong
450
+ stack_trace (" Something has gone very wrong. [ type] could not find a job spawn location." )
451
+ return SSjob. get_last_resort_spawn_points()
452
+
453
+ return spawn_point
454
+
455
+
456
+ // / Returns a fixed spawn location to use. This is probably one of a few job landmarks.
457
+ / datum / job/ proc / get_roundstart_spawn_point_fixed()
458
+ PROTECTED_PROC (TRUE )
459
+ return get_jobspawn_landmark()
443
460
444
- return null // We don't care where we go. Let Ticker decide for us.
461
+ // / Returns a roundstart spawnpoint to use if spawn logic determined it should spawn at a "random" location.
462
+ / datum / job/ proc / get_roundstart_spawn_point_random()
463
+ PROTECTED_PROC (TRUE )
464
+ return SSticker. get_random_spawnpoint()
445
465
466
+ // / Returns an unused jobspawn landmark. You CAN run out of landmarks, please be mindful of this!
467
+ / datum / job/ proc / get_jobspawn_landmark()
468
+ SHOULD_NOT_OVERRIDE (TRUE )
469
+ RETURN_TYPE (/ obj / effect/ landmark/ start)
446
470
447
- // / Handles finding and picking a valid roundstart effect landmark spawn point, in case no uncommon different spawning events occur.
448
- / datum / job/ proc / get_default_roundstart_spawn_point()
449
471
var /obj /effect/landmark/start/spawnpoint = get_start_landmark_for(title)
450
472
if (! spawnpoint)
451
473
log_world (" Couldn't find a round start spawn point for [ title] ." )
474
+ return
452
475
453
476
spawnpoint. used = TRUE
454
477
@@ -474,7 +497,9 @@ GLOBAL_LIST_INIT(job_display_order, list(
474
497
else
475
498
spawn_instance = new spawn_type(player_client. mob. loc)
476
499
spawn_point. JoinPlayerHere(spawn_instance, TRUE )
500
+
477
501
spawn_instance. apply_prefs_job(player_client, src )
502
+
478
503
if (! player_client)
479
504
qdel (spawn_instance)
480
505
return // Disconnected while checking for the appearance ban.
@@ -483,7 +508,7 @@ GLOBAL_LIST_INIT(job_display_order, list(
483
508
484
509
// / Applies the preference options to the spawning mob, taking the job into account. Assumes the client has the proper mind.
485
510
/ mob / living/ proc / apply_prefs_job( client / player_client, datum / job/ job)
486
-
511
+ return
487
512
488
513
/ mob / living/ carbon/ human/ apply_prefs_job( client / player_client, datum / job/ job)
489
514
var /fully_randomize = GLOB . current_anonymous_theme || is_banned_from(player_client. ckey, " Appearance" )
0 commit comments