From a9eabb06585ab9e33735f65dd7a5ebca3c56d775 Mon Sep 17 00:00:00 2001 From: PsyCommando Date: Sat, 23 Mar 2024 15:37:12 -0400 Subject: [PATCH] Update chargen_template.dm --- .../modules/chargen/chargen_spawn_point.dm | 1 + .../modules/chargen/chargen_template.dm | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/mods/persistence/modules/chargen/chargen_spawn_point.dm b/mods/persistence/modules/chargen/chargen_spawn_point.dm index 92364dce8f2..174402af7e3 100644 --- a/mods/persistence/modules/chargen/chargen_spawn_point.dm +++ b/mods/persistence/modules/chargen/chargen_spawn_point.dm @@ -21,6 +21,7 @@ /datum/extension/spawn_position/chargen expected_type = /obj/abstract/landmark/chargen_spawn + provider = /decl/spawnpoint/chargen /datum/extension/spawn_position/chargen/is_busy() return SSchargen.is_chargen_room_busy(get_area(holder)) diff --git a/mods/persistence/modules/chargen/chargen_template.dm b/mods/persistence/modules/chargen/chargen_template.dm index 91381e5353b..53b85e13a18 100644 --- a/mods/persistence/modules/chargen/chargen_template.dm +++ b/mods/persistence/modules/chargen/chargen_template.dm @@ -8,18 +8,18 @@ level_data_type = /datum/level_data/chargen template_parent_type = /datum/map_template/chargen - ///The map file containing the room template we'll use to fill the level + ///The map file containing the room template we'll use to fill the level. Set by the user. var/chargen_prefab_path - ///The amount of rooms we'll instantiate on the level + ///The amount of rooms we'll instantiate on the level. Should be set by the user. var/amount_chargen_rooms = MAX_NB_CHAR_GEN_PODS - ///The width of the chargen room prefab - var/tmp/room_width - ///The height of the chargen room prefab - var/tmp/room_height - ///The amount of rooms that fit between the top and bottom of the map in a single column. - var/tmp/max_rooms_per_column - ///The amount of columns we reserve for placing down chargen rooms. This number also include incomplete columns. - var/tmp/amount_columns + ///The width of the chargen room prefab. Loaded at runtime. + VAR_PRIVATE/tmp/room_width + ///The height of the chargen room prefab. Loaded at runtime. + VAR_PRIVATE/tmp/room_height + ///The amount of rooms that fit between the top and bottom of the map in a single column. Loaded at runtime. + VAR_PRIVATE/tmp/max_rooms_per_column + ///The amount of columns we reserve for placing down chargen rooms. This number also include incomplete columns. Loaded at runtime. + VAR_PRIVATE/tmp/amount_columns /datum/map_template/chargen/get_spawn_weight() return 1 //Must be loaded after the main template @@ -35,6 +35,9 @@ return TRUE /datum/map_template/chargen/load_new_z(no_changeturf, centered) + if(world.maxx <= 0 || world.maxy <= 0) + CRASH("Couldn't load chargen template. The world x/y size was not set prior to loading the template!") + max_rooms_per_column = FLOOR(world.maxy / room_height) amount_columns = (amount_chargen_rooms / max_rooms_per_column)