mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-25 01:22:24 +00:00
Fix suit cycler checks (#7679)
This commit is contained in:
@@ -1151,22 +1151,31 @@
|
||||
|
||||
//END: downstream variant space
|
||||
if(target_species)
|
||||
//Making sure all of our items have the sprites to be refitted.
|
||||
var/helmet_check = ((helmet!=null && (initial(parent_helmet.icon_state) in icon_states(helmet.sprite_sheets_obj[target_species],1))) || helmet==null)
|
||||
//If the helmet exists, only return true if there's also sprites for it. If the helmet doesn't exist, return true.
|
||||
var/suit_check = ((suit!=null && (initial(parent_suit.icon_state) in icon_states(suit.sprite_sheets_obj[target_species],1))) || suit==null)
|
||||
var/suit_helmet_check = ((suit.helmet!=null && (initial(parent_helmet.icon_state) in icon_states(suit.helmet.sprite_sheets_obj[target_species],1))) || suit.helmet==null)
|
||||
if(helmet_check && suit_check && suit_helmet_check)
|
||||
//Only run these checks if they have a sprite sheet defined, otherwise they use human's anyways, and there is almost definitely a sprite.
|
||||
if((helmet!=null&&(target_species in helmet.sprite_sheets_obj))||(suit!=null&&(target_species in suit.sprite_sheets_obj)))
|
||||
//Making sure all of our items have the sprites to be refitted.
|
||||
var/helmet_check = ((helmet!=null && (initial(parent_helmet.icon_state) in icon_states(helmet.sprite_sheets_obj[target_species],1))) || helmet==null)
|
||||
//If the helmet exists, only return true if there's also sprites for it. If the helmet doesn't exist, return true.
|
||||
var/suit_check = ((suit!=null && (initial(parent_suit.icon_state) in icon_states(suit.sprite_sheets_obj[target_species],1))) || suit==null)
|
||||
var/suit_helmet_check = ((suit!=null && suit.helmet!=null && (initial(parent_helmet.icon_state) in icon_states(suit.helmet.sprite_sheets_obj[target_species],1))) || suit==null || suit.helmet==null)
|
||||
if(helmet_check && suit_check && suit_helmet_check)
|
||||
if(helmet)
|
||||
helmet.refit_for_species(target_species)
|
||||
if(suit)
|
||||
suit.refit_for_species(target_species)
|
||||
if(suit.helmet)
|
||||
suit.helmet.refit_for_species(target_species)
|
||||
else
|
||||
//If they don't, alert the user and stop here.
|
||||
T.visible_message("[bicon(src)]<span class='warning'>Unable to apply specified cosmetics with specified species. Please try again with a different species or cosmetic option selected.</span>")
|
||||
return
|
||||
else
|
||||
if(helmet)
|
||||
helmet.refit_for_species(target_species)
|
||||
if(suit)
|
||||
suit.refit_for_species(target_species)
|
||||
if(suit.helmet)
|
||||
suit.helmet.refit_for_species(target_species)
|
||||
else
|
||||
//If they don't, alert the user and stop here.
|
||||
T.visible_message("[bicon(src)]<span class='warning'>Unable to apply specified cosmetics with specified species. Please try again with a different species or cosmetic option selected.</span>")
|
||||
return
|
||||
//look at this! isn't it beautiful? -KK (well ok not beautiful but it's a lot cleaner)
|
||||
if(helmet && target_department != "No Change")
|
||||
var/obj/item/clothing/H = new parent_helmet
|
||||
|
||||
Reference in New Issue
Block a user