Skip to content

Commit

Permalink
Update chargen_template.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
PsyCommando committed Mar 25, 2024
1 parent b892138 commit a9eabb0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions mods/persistence/modules/chargen/chargen_spawn_point.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
23 changes: 13 additions & 10 deletions mods/persistence/modules/chargen/chargen_template.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit a9eabb0

Please sign in to comment.