Skip to content

Commit

Permalink
Allowed for 'no box' to be selected for survival boxes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Mar 22, 2024
1 parent 46a2d53 commit d9d199e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions code/datums/outfits/equipment/survival_box.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
var/name = "survival box option"
var/box_type

/decl/survival_box_option/none
name = "nothing"
uid = "survival_box_nothing"

/decl/survival_box_option/survival
name = "survival kit"
box_type = /obj/item/storage/box/survival
Expand Down
9 changes: 5 additions & 4 deletions code/datums/outfits/outfit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,11 @@ var/global/list/outfits_decls_by_type_

if(H.species && !(OUTFIT_ADJUSTMENT_SKIP_SURVIVAL_GEAR & equip_adjustments))
var/decl/survival_box_option/chosen_survival_box = H?.client?.prefs.survival_box_choice
if(outfit_flags & OUTFIT_EXTENDED_SURVIVAL)
H.species.equip_survival_gear(H, /obj/item/storage/box/engineer)
else if(chosen_survival_box?.box_type)
H.species.equip_survival_gear(H, chosen_survival_box.box_type)
if(chosen_survival_box?.box_type)
if(outfit_flags & OUTFIT_EXTENDED_SURVIVAL)
H.species.equip_survival_gear(H, /obj/item/storage/box/engineer)
else
H.species.equip_survival_gear(H, chosen_survival_box.box_type)

if(H.client?.prefs?.give_passport)
global.using_map.create_passport(H)
Expand Down
8 changes: 6 additions & 2 deletions code/modules/client/preference_setup/general/04_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@
if(!ispath(pref.starting_cash_choice, /decl/starting_cash_choice))
pref.starting_cash_choice = global.using_map.default_starting_cash_choice

if(!pref.survival_box_choice && length(global.using_map.survival_box_choices)) // if you have at least one box available, 'none' must be its own bespoke option
pref.survival_box_choice = global.using_map.survival_box_choices[global.using_map.survival_box_choices[1]]
// if you have at least one box available, 'none' must be its own bespoke option
if(length(global.using_map.survival_box_choices))
if(!pref.survival_box_choice || !(pref.survival_box_choice.type in global.using_map.survival_box_choices))
pref.survival_box_choice = global.using_map.survival_box_choices[global.using_map.survival_box_choices[1]]
else
pref.survival_box_choice = null

/datum/category_item/player_setup_item/physical/equipment/content()
. = list()
Expand Down

0 comments on commit d9d199e

Please sign in to comment.