From 2dfda5ae5fb8da22f4df13653c7df813c53a8cdf Mon Sep 17 00:00:00 2001 From: Nathan Singer Date: Wed, 29 Nov 2023 19:49:48 -0500 Subject: [PATCH] Removes the `infinite_reskin` variable from `/obj` and converts it into a flag (#80014) This variable is only used once so I figured it would work better as a flag since it will take up less needless memory --- code/__DEFINES/obj_flags.dm | 1 + code/game/objects/objs.dm | 8 +++----- code/modules/clothing/under/accessories/badges.dm | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/code/__DEFINES/obj_flags.dm b/code/__DEFINES/obj_flags.dm index 660d05854fd..91b20a45f21 100644 --- a/code/__DEFINES/obj_flags.dm +++ b/code/__DEFINES/obj_flags.dm @@ -13,6 +13,7 @@ #define BLOCKS_CONSTRUCTION (1<<9) //! Does this object prevent things from being built on it? #define BLOCKS_CONSTRUCTION_DIR (1<<10) //! Does this object prevent same-direction things from being built on it? #define IGNORE_DENSITY (1<<11) //! Can we ignore density when building on this object? (for example, directional windows and grilles) +#define INFINITE_RESKIN (1<<12) // We can reskin this item infinitely // If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 9918ef40223..872415c1401 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -27,8 +27,6 @@ var/current_skin //Has the item been reskinned? var/list/unique_reskin //List of options to reskin. - ///If set to true, we can reskin this item as much as we want. - var/infinite_reskin = FALSE // Access levels, used in modules\jobs\access.dm /// List of accesses needed to use this object: The user must possess all accesses in this list in order to use the object. @@ -282,12 +280,12 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) . += span_notice(desc_controls) if(obj_flags & UNIQUE_RENAME) . += span_notice("Use a pen on it to rename it or change its description.") - if(unique_reskin && (!current_skin || infinite_reskin)) + if(unique_reskin && (!current_skin || (obj_flags & INFINITE_RESKIN))) . += span_notice("Alt-click it to reskin it.") /obj/AltClick(mob/user) . = ..() - if(unique_reskin && (!current_skin || infinite_reskin) && user.can_perform_action(src, NEED_DEXTERITY)) + if(unique_reskin && (!current_skin || (obj_flags & INFINITE_RESKIN)) && user.can_perform_action(src, NEED_DEXTERITY)) reskin_obj(user) /** @@ -325,7 +323,7 @@ GLOBAL_LIST_EMPTY(objects_by_id_tag) /obj/proc/check_reskin_menu(mob/user) if(QDELETED(src)) return FALSE - if(!infinite_reskin && current_skin) + if(!(obj_flags & INFINITE_RESKIN) && current_skin) return FALSE if(!istype(user)) return FALSE diff --git a/code/modules/clothing/under/accessories/badges.dm b/code/modules/clothing/under/accessories/badges.dm index 6ef9ca19d3a..f02a21580a8 100644 --- a/code/modules/clothing/under/accessories/badges.dm +++ b/code/modules/clothing/under/accessories/badges.dm @@ -187,8 +187,7 @@ GLOBAL_LIST_INIT(pride_pin_reskins, list( name = "pride pin" desc = "A Nanotrasen Diversity & Inclusion Center-sponsored holographic pin to show off your pride, reminding the crew of their unwavering commitment to equity, diversity, and inclusion!" icon_state = "pride" - obj_flags = UNIQUE_RENAME - infinite_reskin = TRUE + obj_flags = UNIQUE_RENAME | INFINITE_RESKIN /obj/item/clothing/accessory/pride/Initialize(mapload) . = ..()