diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 38afa0e9c0b..67c2ea402b5 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -115,7 +115,9 @@ #define HAS_TRAIT_NOT_FROM(target, trait, source) (HAS_TRAIT(target, trait) && (length(target._status_traits[trait] - source) > 0)) /// Returns a list of trait sources for this trait. Only useful for wacko cases and internal futzing /// You should not be using this -#define GET_TRAIT_SOURCES(target, trait) target._status_traits?[trait] || list() +#define GET_TRAIT_SOURCES(target, trait) (target._status_traits?[trait] || list()) +/// Returns the amount of sources for a trait. useful if you don't want to have a "thing counter" stuck around all the time +#define COUNT_TRAIT_SOURCES(target, trait) length(GET_TRAIT_SOURCES(target, trait)) /// A simple helper for checking traits in a mob's mind #define HAS_MIND_TRAIT(target, trait) (HAS_TRAIT(target, trait) || (target.mind ? HAS_TRAIT(target.mind, trait) : FALSE)) diff --git a/code/datums/elements/sticker.dm b/code/datums/elements/sticker.dm index 57b63dad894..3cc8e977daf 100644 --- a/code/datums/elements/sticker.dm +++ b/code/datums/elements/sticker.dm @@ -39,7 +39,7 @@ ///Add our stick_type to the target with px and py as pixel x and pixel y respectively /datum/element/sticker/proc/do_stick(obj/item/source, atom/target, mob/living/user, px, py) - if(length(GET_TRAIT_SOURCES(target, TRAIT_STICKERED)) >= MAX_ALLOWED_STICKERS) + if(COUNT_TRAIT_SOURCES(target, TRAIT_STICKERED) >= MAX_ALLOWED_STICKERS) source.balloon_alert_to_viewers("sticker won't stick!") return FALSE target.AddComponent(stick_type, px, py, source, user, washable)