From df11eed945351925bd2f187ecf4a201b9e67ef9f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 1 Dec 2023 03:10:06 +0100 Subject: [PATCH] [MIRROR] Removes the `infinite_reskin` variable from `/obj` and converts it into a flag [MDB IGNORE] (#25342) * 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 * Removes the `infinite_reskin` variable from `/obj` and converts it into a flag --------- Co-authored-by: Nathan Singer --- 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 6cfb940bb71..008ceccc72e 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. @@ -280,12 +278,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) /** @@ -323,7 +321,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 56bfdc599dd..5c546c3fc0d 100644 --- a/code/modules/clothing/under/accessories/badges.dm +++ b/code/modules/clothing/under/accessories/badges.dm @@ -189,8 +189,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) . = ..()