From 94198bf00755e4f0f086961279ab3c415d1ef8cb Mon Sep 17 00:00:00 2001 From: TheGreatKitsune <88862343+TheGreatKitsune@users.noreply.github.com> Date: Wed, 11 Mar 2026 15:21:02 -0500 Subject: [PATCH] Default spawnpoint (#19258) * Add a default spawn location * Fix the unit test hopefully * Rename and clean up the unit test * Change it to use a defined spawnpoint datum * Fix the build hopefully * Fix the build x2 * Fix the build x3 --- code/__defines/preferences.dm | 2 ++ .../client/preferences/types/character/general/01_basic.dm | 4 ++++ code/modules/unit_tests/map_tests.dm | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/code/__defines/preferences.dm b/code/__defines/preferences.dm index 3b027e78dc0..63474194832 100644 --- a/code/__defines/preferences.dm +++ b/code/__defines/preferences.dm @@ -76,3 +76,5 @@ #define PAI_UNSET "None Set" #define PAI_DEFAULT_CHASSIS "Drone" #define PAI_DEFAULT_EMAGGED_CHASSIS "Syndicate Fox" + +#define DEFAULT_LATEJOIN_LOCATION /datum/spawnpoint/arrivals diff --git a/code/modules/client/preferences/types/character/general/01_basic.dm b/code/modules/client/preferences/types/character/general/01_basic.dm index 022407bf5dd..9f0e55cacdd 100644 --- a/code/modules/client/preferences/types/character/general/01_basic.dm +++ b/code/modules/client/preferences/types/character/general/01_basic.dm @@ -173,6 +173,10 @@ /datum/preference/choiced/living/spawnpoint/apply_to_living(mob/living/target, value) return // handled in job_controller +/datum/preference/choiced/living/spawnpoint/create_default_value() + var/datum/spawnpoint/default_spawnpoint = DEFAULT_LATEJOIN_LOCATION + return default_spawnpoint::display_name + /datum/preference/text/living/private_notes category = PREFERENCE_CATEGORY_MANUALLY_RENDERED savefile_identifier = PREFERENCE_CHARACTER diff --git a/code/modules/unit_tests/map_tests.dm b/code/modules/unit_tests/map_tests.dm index 19672b866b2..eb1e1250c9b 100644 --- a/code/modules/unit_tests/map_tests.dm +++ b/code/modules/unit_tests/map_tests.dm @@ -206,3 +206,9 @@ if(failed) TEST_FAIL("Map has smes with duplicated RCon_tag") + +/datum/unit_test/default_spawnpoint_exists + +/datum/unit_test/default_spawnpoint_exists/Run() + var/datum/spawnpoint/default_spawnpoint = new DEFAULT_LATEJOIN_LOCATION() + TEST_ASSERT(LAZYLEN(default_spawnpoint.turfs), "Map does not define the default spawnpoint location ([default_spawnpoint.display_name])")