From f9d829b111fd18e56e03b4734c80752229a0ecd9 Mon Sep 17 00:00:00 2001 From: Chayse Ramsay Date: Sun, 4 Aug 2019 05:48:08 +0100 Subject: [PATCH] Proc to define --- code/__DEFINES/inventory.dm | 3 +++ code/_onclick/hud/screen_objects.dm | 2 +- code/game/objects/items/tanks/tanks.dm | 2 +- code/modules/mob/living/carbon/inventory.dm | 6 ------ code/modules/mob/living/carbon/life.dm | 6 +----- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/code/__DEFINES/inventory.dm b/code/__DEFINES/inventory.dm index 03cfde802f..5e200c38c0 100644 --- a/code/__DEFINES/inventory.dm +++ b/code/__DEFINES/inventory.dm @@ -230,3 +230,6 @@ GLOBAL_LIST_INIT(security_wintercoat_allowed, typecacheof(list( /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, /obj/item/toy))) + +//Internals checker +#define GET_INTERNAL_SLOTS(C) list(C.head, C.wear_mask) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 75349c5789..4c666d708c 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -293,7 +293,7 @@ var/obj/item/clothing/check var/internals = FALSE - for(check in C.get_internal_slots()) + for(check in GET_INTERNAL_SLOTS(C)) if(istype(check, /obj/item/clothing/mask)) var/obj/item/clothing/mask/M = check if(M.mask_adjusted) diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 0ddca78c95..d409e40575 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -36,7 +36,7 @@ var/obj/item/clothing/check var/internals = FALSE - for(check in H.get_internal_slots()) + for(check in GET_INTERNAL_SLOTS(H)) if(istype(check, /obj/item/clothing/mask)) var/obj/item/clothing/mask/M = check if(M.mask_adjusted) diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm index 2c4627b0ee..bc2d6132e1 100644 --- a/code/modules/mob/living/carbon/inventory.dm +++ b/code/modules/mob/living/carbon/inventory.dm @@ -140,9 +140,3 @@ /mob/living/carbon/proc/get_holding_bodypart_of_item(obj/item/I) var/index = get_held_index_of_item(I) return index && hand_bodyparts[index] - -/mob/living/carbon/proc/get_internal_slots() - return list( - head, - wear_mask, - ) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 999544d1f7..19e04fb43c 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -306,12 +306,8 @@ /mob/living/carbon/proc/get_breath_from_internal(volume_needed) var/obj/item/clothing/check var/internals = FALSE - var/internalslots = list( - head, - wear_mask, - ) - for(check in internalslots) + for(check in GET_INTERNAL_SLOTS(src)) if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS)) internals = TRUE if(internal)