From 243231eb48a07d8d1a3cc649bad114495a3684a6 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Tue, 27 Sep 2022 17:51:45 -0400 Subject: [PATCH] Properly checks flags with & instead of == (#70130) * Makes flags properly check themselves Byond ref: https://www.byond.com/docs/ref/#/operator/& Basically, flags should use & instead of == We can have more than 1 slot on any item, so it's preferred that we do this instead. Even if it doesn't immediately fix any problems, it's something that should be the standard anyways to prevent it from ever being a problem. Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/__DEFINES/dcs/signals/signals_object.dm | 2 +- code/_onclick/telekinesis.dm | 2 +- code/datums/ai/cursed/cursed_controller.dm | 4 ++-- code/datums/components/shielded.dm | 2 +- code/datums/components/spill.dm | 2 +- code/datums/components/tactical.dm | 2 +- code/datums/components/twohanded.dm | 2 +- code/datums/elements/earhealing.dm | 2 +- code/datums/martial/boxing.dm | 2 +- code/datums/martial/krav_maga.dm | 2 +- code/datums/martial/wrestling.dm | 2 +- code/datums/quirks/negative.dm | 2 +- code/datums/storage/storage.dm | 2 +- code/game/objects/items.dm | 4 ++-- code/game/objects/items/RCD.dm | 2 +- code/game/objects/items/RPD.dm | 2 +- code/game/objects/items/cards_ids.dm | 2 +- code/game/objects/items/cigs_lighters.dm | 2 +- code/game/objects/items/defib.dm | 12 ++++++------ code/game/objects/items/devices/megaphone.dm | 2 +- code/game/objects/items/devices/spyglasses.dm | 4 ++-- code/game/objects/items/devices/traitordevices.dm | 2 +- code/game/objects/items/food/bread.dm | 2 +- code/game/objects/items/scrolls.dm | 2 +- code/game/objects/items/storage/holsters.dm | 2 +- code/game/objects/items/tanks/watertank.dm | 6 +++--- .../antagonists/abductor/equipment/abduction_gear.dm | 2 +- code/modules/antagonists/changeling/changeling.dm | 6 +++--- code/modules/antagonists/cult/cult_items.dm | 2 +- .../antagonists/heretic/items/heretic_necks.dm | 2 +- .../antagonists/heretic/items/madness_mask.dm | 2 +- .../antagonists/traitor/objectives/assassination.dm | 2 +- code/modules/clothing/glasses/_glasses.dm | 12 ++++++------ code/modules/clothing/glasses/hud.dm | 2 +- code/modules/clothing/gloves/special.dm | 2 +- code/modules/clothing/gloves/tacklers.dm | 2 +- code/modules/clothing/head/animalears.dm | 2 +- code/modules/clothing/head/costume.dm | 2 +- code/modules/clothing/head/frenchberet.dm | 2 +- code/modules/clothing/head/jobs.dm | 2 +- code/modules/clothing/head/mind_monkey_helmet.dm | 2 +- code/modules/clothing/head/pirate.dm | 2 +- code/modules/clothing/head/tinfoilhat.dm | 2 +- code/modules/clothing/head/wig.dm | 4 ++-- code/modules/clothing/masks/_masks.dm | 2 +- code/modules/clothing/masks/animal_masks.dm | 2 +- code/modules/clothing/masks/boxing.dm | 2 +- code/modules/clothing/shoes/clown.dm | 2 +- code/modules/clothing/shoes/cowboy.dm | 2 +- code/modules/clothing/shoes/gunboots.dm | 2 +- code/modules/clothing/shoes/magboots.dm | 2 +- code/modules/clothing/spacesuits/_spacesuits.dm | 2 +- code/modules/clothing/suits/costume.dm | 4 ++-- code/modules/clothing/suits/ethereal.dm | 2 +- code/modules/clothing/suits/toggles.dm | 10 +++++----- code/modules/clothing/under/_under.dm | 6 +++--- code/modules/clothing/under/ethereal.dm | 2 +- code/modules/hydroponics/grown/flowers.dm | 2 +- code/modules/mining/equipment/kheiral_cuffs.dm | 4 ++-- code/modules/mining/lavaland/tendril_loot.dm | 6 +++--- .../mob/living/carbon/human/human_update_icons.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 4 ++-- .../mob/living/carbon/human/species_types/monkeys.dm | 2 +- .../mob/living/silicon/robot/robot_defense.dm | 4 ++-- .../hostile/megafauna/demonic_frost_miner.dm | 2 +- .../simple_animal/hostile/mining_mobs/brimdemon.dm | 2 +- code/modules/mod/mod_control.dm | 4 ++-- .../file_system/programs/atmosscan.dm | 4 ++-- code/modules/paperwork/fax.dm | 2 +- code/modules/power/singularity/singularity.dm | 2 +- code/modules/reagents/chemistry/holder.dm | 2 +- .../modules/reagents/reagent_containers/cups/_cup.dm | 2 +- .../research/xenobiology/crossbreeding/_clothing.dm | 4 ++-- code/modules/surgery/tools.dm | 2 +- 74 files changed, 107 insertions(+), 107 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 0157acc4024..bb307955d9a 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -100,7 +100,7 @@ // /obj/item signals -///from base of obj/item/equipped(): (/mob/equipper, slot) +///from base of obj/item/equipped(): (mob/equipper, slot) #define COMSIG_ITEM_EQUIPPED "item_equip" /// A mob has just equipped an item. Called on [/mob] from base of [/obj/item/equipped()]: (/obj/item/equipped_item, slot) #define COMSIG_MOB_EQUIPPED_ITEM "mob_equipped_item" diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 8a02e185cfa..fb828f4893f 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -127,7 +127,7 @@ //stops TK grabs being equipped anywhere but into hands /obj/item/tk_grab/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_HANDS) + if(slot & ITEM_SLOT_HANDS) return qdel(src) diff --git a/code/datums/ai/cursed/cursed_controller.dm b/code/datums/ai/cursed/cursed_controller.dm index 11501a3f9fb..468273fa5c8 100644 --- a/code/datums/ai/cursed/cursed_controller.dm +++ b/code/datums/ai/cursed/cursed_controller.dm @@ -50,10 +50,10 @@ /datum/ai_controller/cursed/proc/try_equipping_to_target_slot(mob/living/carbon/curse_victim, slot_already_in) var/obj/item/item_pawn = pawn var/attempted_slot = blackboard[BB_TARGET_SLOT] - if(slot_already_in && attempted_slot == slot_already_in) //thanks for making it easy + if(slot_already_in && (attempted_slot & slot_already_in)) //thanks for making it easy what_a_horrible_night_to_have_a_curse() return - if(attempted_slot == ITEM_SLOT_HANDS) //hands needs some different checks + if(attempted_slot & ITEM_SLOT_HANDS) //hands needs some different checks curse_victim.drop_all_held_items() if(curse_victim.put_in_hands(item_pawn, del_on_fail = FALSE)) to_chat(curse_victim, span_danger("[item_pawn] leaps into your hands!")) diff --git a/code/datums/components/shielded.dm b/code/datums/components/shielded.dm index d314899171c..8ac76047a8b 100644 --- a/code/datums/components/shielded.dm +++ b/code/datums/components/shielded.dm @@ -107,7 +107,7 @@ /datum/component/shielded/proc/on_equipped(datum/source, mob/user, slot) SIGNAL_HANDLER - if(slot == ITEM_SLOT_HANDS && !shield_inhand) + if((slot & ITEM_SLOT_HANDS) && !shield_inhand) lost_wearer(source, user) return set_wearer(source, user) diff --git a/code/datums/components/spill.dm b/code/datums/components/spill.dm index 0349d155331..e04b24c31ef 100644 --- a/code/datums/components/spill.dm +++ b/code/datums/components/spill.dm @@ -45,7 +45,7 @@ /datum/component/spill/proc/equip_react(obj/item/source, mob/equipper, slot) SIGNAL_HANDLER - if(slot == ITEM_SLOT_LPOCKET || slot == ITEM_SLOT_RPOCKET) + if(slot & (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET)) RegisterSignal(equipper, COMSIG_LIVING_STATUS_KNOCKDOWN, .proc/knockdown_react, TRUE) else UnregisterSignal(equipper, COMSIG_LIVING_STATUS_KNOCKDOWN) diff --git a/code/datums/components/tactical.dm b/code/datums/components/tactical.dm index 42391e114ec..f823d726a41 100644 --- a/code/datums/components/tactical.dm +++ b/code/datums/components/tactical.dm @@ -32,7 +32,7 @@ /datum/component/tactical/proc/modify(obj/item/source, mob/user, slot) SIGNAL_HANDLER - if(allowed_slot && slot != allowed_slot) + if(allowed_slot && !(slot & allowed_slot)) unmodify() return diff --git a/code/datums/components/twohanded.dm b/code/datums/components/twohanded.dm index d57feff2984..54a6a18e06d 100644 --- a/code/datums/components/twohanded.dm +++ b/code/datums/components/twohanded.dm @@ -107,7 +107,7 @@ /datum/component/two_handed/proc/on_equip(datum/source, mob/user, slot) SIGNAL_HANDLER - if(require_twohands && slot == ITEM_SLOT_HANDS) // force equip the item + if(require_twohands && (slot & ITEM_SLOT_HANDS)) // force equip the item wield(user) if(!user.is_holding(parent) && wielded && !require_twohands) unwield(user) diff --git a/code/datums/elements/earhealing.dm b/code/datums/elements/earhealing.dm index 9ec7cdff06e..fee367348d4 100644 --- a/code/datums/elements/earhealing.dm +++ b/code/datums/elements/earhealing.dm @@ -17,7 +17,7 @@ /datum/element/earhealing/proc/on_equip(datum/source, mob/living/carbon/user, slot) SIGNAL_HANDLER - if(slot == ITEM_SLOT_EARS && istype(user)) + if((slot & ITEM_SLOT_EARS) && istype(user)) START_PROCESSING(SSdcs, src) user_by_item[source] = user else diff --git a/code/datums/martial/boxing.dm b/code/datums/martial/boxing.dm index ed6da90812e..9f79115630c 100644 --- a/code/datums/martial/boxing.dm +++ b/code/datums/martial/boxing.dm @@ -64,7 +64,7 @@ // boxing requires human if(!ishuman(user)) return - if(slot == ITEM_SLOT_GLOVES) + if(slot & ITEM_SLOT_GLOVES) var/mob/living/student = user style.teach(student, 1) diff --git a/code/datums/martial/krav_maga.dm b/code/datums/martial/krav_maga.dm index a801d56daa7..b35e0fd3798 100644 --- a/code/datums/martial/krav_maga.dm +++ b/code/datums/martial/krav_maga.dm @@ -170,7 +170,7 @@ /obj/item/clothing/gloves/krav_maga/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_GLOVES) + if(slot & ITEM_SLOT_GLOVES) style.teach(user, TRUE) /obj/item/clothing/gloves/krav_maga/dropped(mob/user) diff --git a/code/datums/martial/wrestling.dm b/code/datums/martial/wrestling.dm index 20b3f22e76f..ccebdb64ef1 100644 --- a/code/datums/martial/wrestling.dm +++ b/code/datums/martial/wrestling.dm @@ -468,7 +468,7 @@ If you make a derivative work from this code, you must include this notification /obj/item/storage/belt/champion/wrestling/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_BELT) + if(slot & ITEM_SLOT_BELT) style.teach(user, TRUE) return diff --git a/code/datums/quirks/negative.dm b/code/datums/quirks/negative.dm index a5e87e3506f..3799d7b6fd2 100644 --- a/code/datums/quirks/negative.dm +++ b/code/datums/quirks/negative.dm @@ -33,7 +33,7 @@ /datum/quirk/badback/proc/on_equipped_item(mob/living/source, obj/item/equipped_item, slot) SIGNAL_HANDLER - if((slot != ITEM_SLOT_BACK) || !istype(equipped_item, /obj/item/storage/backpack)) + if(!(slot & ITEM_SLOT_BACK) || !istype(equipped_item, /obj/item/storage/backpack)) return quirk_holder.add_mood_event("back_pain", /datum/mood_event/back_pain) diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm index dc84ddb56fb..ae6d0f3dc53 100644 --- a/code/datums/storage/storage.dm +++ b/code/datums/storage/storage.dm @@ -268,7 +268,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches) return "\n\t[span_notice("[desc.Join("\n\t")]")]" /// Updates the action button for toggling collectmode. -/datum/storage/proc/update_actions() +/datum/storage/proc/update_actions(atom/source, mob/equipper, slot) SIGNAL_HANDLER var/obj/item/resolve_parent = parent?.resolve() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index dffcfe4a104..2a18728f8f9 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -689,7 +689,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(!initial) if(equip_sound && (slot_flags & slot)) playsound(src, equip_sound, EQUIP_SOUND_VOLUME, TRUE, ignore_walls = FALSE) - else if(slot == ITEM_SLOT_HANDS) + else if(slot & ITEM_SLOT_HANDS) playsound(src, pickup_sound, PICKUP_SOUND_VOLUME, ignore_walls = FALSE) user.update_equipment_speed_mods() @@ -707,7 +707,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons /// Sometimes we only want to grant the item's action if it's equipped in a specific slot. /obj/item/proc/item_action_slot_check(slot, mob/user) - if(slot == ITEM_SLOT_BACKPACK || slot == ITEM_SLOT_LEGCUFFED) //these aren't true slots, so avoid granting actions there + if(slot & (ITEM_SLOT_BACKPACK|ITEM_SLOT_LEGCUFFED)) //these aren't true slots, so avoid granting actions there return FALSE return TRUE diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 0d6c9b0ab35..f0b4e63ab9e 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -1119,7 +1119,7 @@ GLOBAL_VAR_INIT(icon_holographic_window, init_holographic_window()) /obj/item/construction/plumbing/equipped(mob/user, slot, initial) . = ..() - if(slot == ITEM_SLOT_HANDS) + if(slot & ITEM_SLOT_HANDS) RegisterSignal(user, COMSIG_MOUSE_SCROLL_ON, .proc/mouse_wheeled) else UnregisterSignal(user, COMSIG_MOUSE_SCROLL_ON) diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm index f376c9d6358..cb926c5d9f5 100644 --- a/code/game/objects/items/RPD.dm +++ b/code/game/objects/items/RPD.dm @@ -252,7 +252,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list( /obj/item/pipe_dispenser/equipped(mob/user, slot, initial) . = ..() - if(slot == ITEM_SLOT_HANDS) + if(slot & ITEM_SLOT_HANDS) RegisterSignal(user, COMSIG_MOUSE_SCROLL_ON, .proc/mouse_wheeled) else UnregisterSignal(user,COMSIG_MOUSE_SCROLL_ON) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index bd70a2081f6..0f4d0c24cf0 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -923,7 +923,7 @@ balloon_alert(user, "recolored") update_icon() -/obj/item/card/id/advanced/proc/update_intern_status(datum/source, mob/user) +/obj/item/card/id/advanced/proc/update_intern_status(datum/source, mob/user, slot) SIGNAL_HANDLER if(!user?.client) diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index 80f1c9daee9..2fd5f2cfb88 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -1001,7 +1001,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/clothing/mask/vape/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_MASK) + if(!(slot & ITEM_SLOT_MASK)) return if(screw) diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index cfe92525fcb..24f09c244af 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -107,13 +107,13 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE /obj/item/defibrillator/attack_hand(mob/user, list/modifiers) if(loc == user) - if(slot_flags == ITEM_SLOT_BACK) + if(slot_flags & ITEM_SLOT_BACK) if(user.get_item_by_slot(ITEM_SLOT_BACK) == src) ui_action_click() else to_chat(user, span_warning("Put the defibrillator on your back first!")) - else if(slot_flags == ITEM_SLOT_BELT) + else if(slot_flags & ITEM_SLOT_BELT) if(user.get_item_by_slot(ITEM_SLOT_BELT) == src) ui_action_click() else @@ -210,13 +210,13 @@ /obj/item/defibrillator/equipped(mob/user, slot) ..() - if((slot_flags == ITEM_SLOT_BACK && slot != ITEM_SLOT_BACK) || (slot_flags == ITEM_SLOT_BELT && slot != ITEM_SLOT_BELT)) + if(!(slot_flags & slot)) remove_paddles(user) update_power() /obj/item/defibrillator/item_action_slot_check(slot, mob/user) - if(slot == user.getBackSlot()) - return 1 + if(slot_flags & slot) + return TRUE /obj/item/defibrillator/proc/remove_paddles(mob/user) //this fox the bug with the paddles when other player stole you the defib when you have the paddles equiped if(ismob(paddles.loc)) @@ -279,7 +279,7 @@ emagged_state = "defibcompact-emagged" /obj/item/defibrillator/compact/item_action_slot_check(slot, mob/user) - if(slot == user.getBeltSlot()) + if(slot & user.getBeltSlot()) return TRUE /obj/item/defibrillator/compact/loaded/Initialize(mapload) diff --git a/code/game/objects/items/devices/megaphone.dm b/code/game/objects/items/devices/megaphone.dm index 41c569f6af6..dc7402abb16 100644 --- a/code/game/objects/items/devices/megaphone.dm +++ b/code/game/objects/items/devices/megaphone.dm @@ -19,7 +19,7 @@ /obj/item/megaphone/equipped(mob/M, slot) . = ..() - if (slot == ITEM_SLOT_HANDS && !HAS_TRAIT(M, TRAIT_SIGN_LANG)) + if ((slot & ITEM_SLOT_HANDS) && !HAS_TRAIT(M, TRAIT_SIGN_LANG)) RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) else UnregisterSignal(M, COMSIG_MOB_SAY) diff --git a/code/game/objects/items/devices/spyglasses.dm b/code/game/objects/items/devices/spyglasses.dm index 33110dac0dc..83f7bef775d 100644 --- a/code/game/objects/items/devices/spyglasses.dm +++ b/code/game/objects/items/devices/spyglasses.dm @@ -24,7 +24,7 @@ /obj/item/clothing/glasses/sunglasses/spy/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_EYES) + if(!(slot & ITEM_SLOT_EYES)) user.client?.close_popup("spypopup") /obj/item/clothing/glasses/sunglasses/spy/dropped(mob/user) @@ -35,7 +35,7 @@ show_to_user(user) /obj/item/clothing/glasses/sunglasses/spy/item_action_slot_check(slot) - if(slot == ITEM_SLOT_EYES) + if(slot & ITEM_SLOT_EYES) return TRUE /obj/item/clothing/glasses/sunglasses/spy/Destroy() diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index 7ce0bdc758d..1c2af9c926d 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -229,7 +229,7 @@ effective or pretty fucking useless. return /obj/item/shadowcloak/item_action_slot_check(slot, mob/user) - if(slot == ITEM_SLOT_BELT) + if(slot & ITEM_SLOT_BELT) return 1 /obj/item/shadowcloak/proc/Activate(mob/living/carbon/human/user) diff --git a/code/game/objects/items/food/bread.dm b/code/game/objects/items/food/bread.dm index 487a3c2ff84..b1449ae95d5 100644 --- a/code/game/objects/items/food/bread.dm +++ b/code/game/objects/items/food/bread.dm @@ -320,7 +320,7 @@ /obj/item/food/baguette/proc/on_sword_equipped(datum/source, mob/equipper, slot) SIGNAL_HANDLER - if(slot != ITEM_SLOT_HANDS) + if(!(slot & ITEM_SLOT_HANDS)) end_swordplay() /obj/item/food/garlicbread diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm index 46b1955b1d0..9f615569f64 100644 --- a/code/game/objects/items/scrolls.dm +++ b/code/game/objects/items/scrolls.dm @@ -23,7 +23,7 @@ teleport.button_icon_state = icon_state /obj/item/teleportation_scroll/item_action_slot_check(slot, mob/user) - return (slot == ITEM_SLOT_HANDS) + return (slot & ITEM_SLOT_HANDS) /obj/item/teleportation_scroll/apprentice name = "lesser scroll of teleportation" diff --git a/code/game/objects/items/storage/holsters.dm b/code/game/objects/items/storage/holsters.dm index abcf0d4b10d..84eb1978fea 100644 --- a/code/game/objects/items/storage/holsters.dm +++ b/code/game/objects/items/storage/holsters.dm @@ -10,7 +10,7 @@ /obj/item/storage/belt/holster/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_BELT || ITEM_SLOT_SUITSTORE) + if(slot & (ITEM_SLOT_BELT|ITEM_SLOT_SUITSTORE)) ADD_TRAIT(user, TRAIT_GUNFLIP, CLOTHING_TRAIT) /obj/item/storage/belt/holster/dropped(mob/user) diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index b63034fac1d..71568930df1 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -33,7 +33,7 @@ toggle_mister(user) /obj/item/watertank/item_action_slot_check(slot, mob/user) - if(slot == user.getBackSlot()) + if(slot & user.getBackSlot()) return 1 /obj/item/watertank/proc/toggle_mister(mob/living/user) @@ -73,7 +73,7 @@ /obj/item/watertank/equipped(mob/user, slot) ..() - if(slot != ITEM_SLOT_BACK) + if(!(slot & ITEM_SLOT_BACK)) remove_noz() /obj/item/watertank/proc/remove_noz() @@ -406,7 +406,7 @@ toggle_injection() /obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user) - if(slot == ITEM_SLOT_BACK) + if(slot & ITEM_SLOT_BACK) return 1 /obj/item/reagent_containers/chemtank/proc/toggle_injection() diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index cbd6ba45fff..9b36d853afb 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -59,7 +59,7 @@ update_action_buttons() /obj/item/clothing/suit/armor/abductor/vest/item_action_slot_check(slot, mob/user) - if(slot == ITEM_SLOT_OCLOTHING) //we only give the mob the ability to activate the vest if he's actually wearing it. + if(slot & ITEM_SLOT_OCLOTHING) //we only give the mob the ability to activate the vest if he's actually wearing it. return TRUE /obj/item/clothing/suit/armor/abductor/vest/proc/SetDisguise(datum/icon_snapshot/entry) diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index cbceccbbbbb..896e6cad5c3 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -97,7 +97,7 @@ /// A list of all memories we've stolen through absorbs. var/list/stolen_memories = list() - + /// Keeps track of the currently selected profile. var/datum/changeling_profile/current_profile @@ -461,7 +461,7 @@ new_profile.dna = new_dna new_profile.name = target.real_name new_profile.protected = protect - + new_profile.age = target.age new_profile.physique = target.physique @@ -474,7 +474,7 @@ new_profile.underwear_color = target.underwear_color new_profile.undershirt = target.undershirt new_profile.socks = target.socks - + // Hair and facial hair gradients, alongside their colours. new_profile.grad_style = LAZYLISTDUPLICATE(target.grad_style) new_profile.grad_color = LAZYLISTDUPLICATE(target.grad_color) diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 2aa0e796dc4..6f8515894fd 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -350,7 +350,7 @@ Striking a noncultist, however, will tear their flesh."} /obj/item/clothing/glasses/hud/health/night/cultblind/equipped(mob/living/user, slot) ..() - if(user.stat != DEAD && !IS_CULTIST(user) && slot == ITEM_SLOT_EYES) + if(user.stat != DEAD && !IS_CULTIST(user) && (slot & ITEM_SLOT_EYES)) to_chat(user, span_cultlarge("\"You want to be blind, do you?\"")) user.dropItemToGround(src, TRUE) user.set_dizzy_if_lower(1 MINUTES) diff --git a/code/modules/antagonists/heretic/items/heretic_necks.dm b/code/modules/antagonists/heretic/items/heretic_necks.dm index 8b2cece62f2..e72d2e8172f 100644 --- a/code/modules/antagonists/heretic/items/heretic_necks.dm +++ b/code/modules/antagonists/heretic/items/heretic_necks.dm @@ -25,7 +25,7 @@ /obj/item/clothing/neck/eldritch_amulet/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_NECK) + if(!(slot & ITEM_SLOT_NECK)) return if(!ishuman(user) || !IS_HERETIC_OR_MONSTER(user)) return diff --git a/code/modules/antagonists/heretic/items/madness_mask.dm b/code/modules/antagonists/heretic/items/madness_mask.dm index 0208c3f4c30..e620a95c01d 100644 --- a/code/modules/antagonists/heretic/items/madness_mask.dm +++ b/code/modules/antagonists/heretic/items/madness_mask.dm @@ -25,7 +25,7 @@ /obj/item/clothing/mask/madness_mask/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_MASK) + if(!(slot & ITEM_SLOT_MASK)) return if(!ishuman(user) || !user.mind) return diff --git a/code/modules/antagonists/traitor/objectives/assassination.dm b/code/modules/antagonists/traitor/objectives/assassination.dm index 419932da713..fa7d0a4d021 100644 --- a/code/modules/antagonists/traitor/objectives/assassination.dm +++ b/code/modules/antagonists/traitor/objectives/assassination.dm @@ -99,7 +99,7 @@ return //your target please if(equipper.stat != DEAD) return //kill them please - if(slot != ITEM_SLOT_LPOCKET && slot != ITEM_SLOT_RPOCKET) + if(!(slot & (ITEM_SLOT_LPOCKET|ITEM_SLOT_RPOCKET))) return //in their pockets please succeed_objective() diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index 3cc547b3c56..8167fff5906 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -152,7 +152,7 @@ clothing_traits = list(TRAIT_REAGENT_SCANNER, TRAIT_RESEARCH_SCANNER) /obj/item/clothing/glasses/science/item_action_slot_check(slot) - if(slot == ITEM_SLOT_EYES) + if(slot & ITEM_SLOT_EYES) return 1 /obj/item/clothing/glasses/science/suicide_act(mob/living/carbon/user) @@ -384,7 +384,7 @@ /obj/item/clothing/glasses/blindfold/equipped(mob/living/carbon/human/user, slot) . = ..() - if(slot == ITEM_SLOT_EYES) + if(slot & ITEM_SLOT_EYES) user.become_blind(BLINDFOLD_TRAIT) /obj/item/clothing/glasses/blindfold/dropped(mob/living/carbon/human/user) @@ -405,7 +405,7 @@ var/colored_before = FALSE /obj/item/clothing/glasses/blindfold/white/visual_equipped(mob/living/carbon/human/user, slot) - if(ishuman(user) && slot == ITEM_SLOT_EYES) + if(ishuman(user) && (slot & ITEM_SLOT_EYES)) update_icon(ALL, user) user.update_worn_glasses() //Color might have been changed by update_icon. ..() @@ -455,7 +455,7 @@ /obj/item/clothing/glasses/thermal/xray/equipped(mob/living/carbon/human/user, slot) . = ..() - if(slot != ITEM_SLOT_EYES || !istype(user)) + if(!(slot & ITEM_SLOT_EYES) || !istype(user)) return ADD_TRAIT(user, TRAIT_XRAY_VISION, GLASSES_TRAIT) @@ -559,7 +559,7 @@ /obj/item/clothing/glasses/debug/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_EYES) + if(!(slot & ITEM_SLOT_EYES)) return if(ishuman(user)) for(var/hud in hudlist) @@ -609,7 +609,7 @@ /obj/item/clothing/glasses/salesman/equipped(mob/living/carbon/human/user, slot) ..() - if(slot != ITEM_SLOT_EYES) + if(!(slot & ITEM_SLOT_EYES)) return bigshot = user RegisterSignal(bigshot, COMSIG_CARBON_SANITY_UPDATE, .proc/moodshift) diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index b567b5e03e1..e94879abd50 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -9,7 +9,7 @@ /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() - if(slot != ITEM_SLOT_EYES) + if(!(slot & ITEM_SLOT_EYES)) return if(hud_type) var/datum/atom_hud/our_hud = GLOB.huds[hud_type] diff --git a/code/modules/clothing/gloves/special.dm b/code/modules/clothing/gloves/special.dm index bd09fc4451a..926d339ff15 100644 --- a/code/modules/clothing/gloves/special.dm +++ b/code/modules/clothing/gloves/special.dm @@ -19,7 +19,7 @@ /obj/item/clothing/gloves/cargo_gauntlet/proc/on_glove_equip(datum/source, mob/equipper, slot) SIGNAL_HANDLER - if(slot != ITEM_SLOT_GLOVES) + if(!(slot & ITEM_SLOT_GLOVES)) return var/datum/component/strong_pull/pull_component = pull_component_weakref?.resolve() diff --git a/code/modules/clothing/gloves/tacklers.dm b/code/modules/clothing/gloves/tacklers.dm index 1bee58dc659..16af9af1404 100644 --- a/code/modules/clothing/gloves/tacklers.dm +++ b/code/modules/clothing/gloves/tacklers.dm @@ -31,7 +31,7 @@ . = ..() if(!ishuman(user)) return - if(slot == ITEM_SLOT_GLOVES) + if(slot & ITEM_SLOT_GLOVES) var/mob/living/carbon/human/H = user tackler = H.AddComponent(/datum/component/tackler, stamina_cost=tackle_stam_cost, base_knockdown = base_knockdown, range = tackle_range, speed = tackle_speed, skill_mod = skill_mod, min_distance = min_distance) diff --git a/code/modules/clothing/head/animalears.dm b/code/modules/clothing/head/animalears.dm index 4c60167ff7d..7218b818fe5 100644 --- a/code/modules/clothing/head/animalears.dm +++ b/code/modules/clothing/head/animalears.dm @@ -7,7 +7,7 @@ dog_fashion = /datum/dog_fashion/head/kitty /obj/item/clothing/head/kitty/visual_equipped(mob/living/carbon/human/user, slot) - if(ishuman(user) && slot == ITEM_SLOT_HEAD) + if(ishuman(user) && (slot & ITEM_SLOT_HEAD)) update_icon(ALL, user) user.update_worn_head() //Color might have been changed by update_appearance. ..() diff --git a/code/modules/clothing/head/costume.dm b/code/modules/clothing/head/costume.dm index d94c29a3d41..be7d643dd46 100644 --- a/code/modules/clothing/head/costume.dm +++ b/code/modules/clothing/head/costume.dm @@ -109,7 +109,7 @@ /obj/item/clothing/head/cardborg/equipped(mob/living/user, slot) ..() - if(ishuman(user) && slot == ITEM_SLOT_HEAD) + if(ishuman(user) && (slot & ITEM_SLOT_HEAD)) var/mob/living/carbon/human/H = user if(istype(H.wear_suit, /obj/item/clothing/suit/costume/cardborg)) var/obj/item/clothing/suit/costume/cardborg/CB = H.wear_suit diff --git a/code/modules/clothing/head/frenchberet.dm b/code/modules/clothing/head/frenchberet.dm index f2d14b195ba..cda942edd0f 100644 --- a/code/modules/clothing/head/frenchberet.dm +++ b/code/modules/clothing/head/frenchberet.dm @@ -9,7 +9,7 @@ /obj/item/clothing/head/frenchberet/equipped(mob/M, slot) . = ..() - if (slot == ITEM_SLOT_HEAD) + if (slot & ITEM_SLOT_HEAD) RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) ADD_TRAIT(M, TRAIT_GARLIC_BREATH, type) else diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm index 2c81a633a3f..4b4e220e529 100644 --- a/code/modules/clothing/head/jobs.dm +++ b/code/modules/clothing/head/jobs.dm @@ -223,7 +223,7 @@ /obj/item/clothing/head/warden/drill/equipped(mob/M, slot) . = ..() - if (slot == ITEM_SLOT_HEAD) + if (slot & ITEM_SLOT_HEAD) RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) else UnregisterSignal(M, COMSIG_MOB_SAY) diff --git a/code/modules/clothing/head/mind_monkey_helmet.dm b/code/modules/clothing/head/mind_monkey_helmet.dm index 869ddd1d7f0..ec442dc50d8 100644 --- a/code/modules/clothing/head/mind_monkey_helmet.dm +++ b/code/modules/clothing/head/mind_monkey_helmet.dm @@ -32,7 +32,7 @@ /obj/item/clothing/head/helmet/monkey_sentience/equipped(mob/user, slot) . = ..() - if(slot != ITEM_SLOT_HEAD) + if(!(slot & ITEM_SLOT_HEAD)) return if(!ismonkey(user) || user.ckey) var/mob/living/something = user diff --git a/code/modules/clothing/head/pirate.dm b/code/modules/clothing/head/pirate.dm index 0ddaa4bd639..dece685062c 100644 --- a/code/modules/clothing/head/pirate.dm +++ b/code/modules/clothing/head/pirate.dm @@ -12,7 +12,7 @@ . = ..() if(!ishuman(user)) return - if(slot == ITEM_SLOT_HEAD) + if(slot & ITEM_SLOT_HEAD) user.grant_language(/datum/language/piratespeak/, TRUE, TRUE, LANGUAGE_HAT) to_chat(user, span_boldnotice("You suddenly know how to speak like a pirate!")) diff --git a/code/modules/clothing/head/tinfoilhat.dm b/code/modules/clothing/head/tinfoilhat.dm index a970107b8fa..9520731f455 100644 --- a/code/modules/clothing/head/tinfoilhat.dm +++ b/code/modules/clothing/head/tinfoilhat.dm @@ -24,7 +24,7 @@ /obj/item/clothing/head/foilhat/equipped(mob/living/carbon/human/user, slot) . = ..() - if(slot != ITEM_SLOT_HEAD || warped) + if(!(slot & ITEM_SLOT_HEAD) || warped) return if(paranoia) QDEL_NULL(paranoia) diff --git a/code/modules/clothing/head/wig.dm b/code/modules/clothing/head/wig.dm index 963b7c272d3..9667b92d9f2 100644 --- a/code/modules/clothing/head/wig.dm +++ b/code/modules/clothing/head/wig.dm @@ -16,7 +16,7 @@ /obj/item/clothing/head/wig/equipped(mob/user, slot) . = ..() - if(ishuman(user) && slot == ITEM_SLOT_HEAD) + if(ishuman(user) && (slot & ITEM_SLOT_HEAD)) item_flags |= EXAMINE_SKIP /obj/item/clothing/head/wig/dropped(mob/user) @@ -103,7 +103,7 @@ /obj/item/clothing/head/wig/natural/visual_equipped(mob/living/carbon/human/user, slot) . = ..() - if(ishuman(user) && slot == ITEM_SLOT_HEAD) + if(ishuman(user) && (slot & ITEM_SLOT_HEAD)) if (color != user.hair_color) // only update if necessary add_atom_colour(user.hair_color, FIXED_COLOUR_PRIORITY) update_appearance() diff --git a/code/modules/clothing/masks/_masks.dm b/code/modules/clothing/masks/_masks.dm index 7c3672c6fdf..21980eb2328 100644 --- a/code/modules/clothing/masks/_masks.dm +++ b/code/modules/clothing/masks/_masks.dm @@ -21,7 +21,7 @@ /obj/item/clothing/mask/equipped(mob/M, slot) . = ..() - if (slot == ITEM_SLOT_MASK && modifies_speech) + if ((slot & ITEM_SLOT_MASK) && modifies_speech) RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) else UnregisterSignal(M, COMSIG_MOB_SAY) diff --git a/code/modules/clothing/masks/animal_masks.dm b/code/modules/clothing/masks/animal_masks.dm index 4f16e199673..1c7bbcae78a 100644 --- a/code/modules/clothing/masks/animal_masks.dm +++ b/code/modules/clothing/masks/animal_masks.dm @@ -99,7 +99,7 @@ GLOBAL_LIST_INIT(cursed_animal_masks, list( /obj/item/clothing/mask/animal/equipped(mob/user, slot) if(!iscarbon(user)) return ..() - if(slot == ITEM_SLOT_MASK && HAS_TRAIT_FROM(src, TRAIT_NODROP, CURSED_MASK_TRAIT)) + if((slot & ITEM_SLOT_MASK) && HAS_TRAIT_FROM(src, TRAIT_NODROP, CURSED_MASK_TRAIT)) to_chat(user, span_userdanger("[src] was cursed!")) return ..() diff --git a/code/modules/clothing/masks/boxing.dm b/code/modules/clothing/masks/boxing.dm index b5fbc80443b..819449a7a30 100644 --- a/code/modules/clothing/masks/boxing.dm +++ b/code/modules/clothing/masks/boxing.dm @@ -27,7 +27,7 @@ /obj/item/clothing/mask/infiltrator/equipped(mob/living/carbon/human/user, slot) . = ..() - if(slot != ITEM_SLOT_MASK) + if(!(slot & ITEM_SLOT_MASK)) return to_chat(user, "You roll the balaclava over your face, and a data display appears before your eyes.") ADD_TRAIT(user, TRAIT_DIAGNOSTIC_HUD, MASK_TRAIT) diff --git a/code/modules/clothing/shoes/clown.dm b/code/modules/clothing/shoes/clown.dm index 4b5840d0b9e..1c8ab6caae7 100644 --- a/code/modules/clothing/shoes/clown.dm +++ b/code/modules/clothing/shoes/clown.dm @@ -19,7 +19,7 @@ /obj/item/clothing/shoes/clown_shoes/equipped(mob/living/user, slot) . = ..() - if(slot == ITEM_SLOT_FEET) + if(slot & ITEM_SLOT_FEET) if(enabled_waddle) user.AddElement(/datum/element/waddling) if(is_clown_job(user.mind?.assigned_role)) diff --git a/code/modules/clothing/shoes/cowboy.dm b/code/modules/clothing/shoes/cowboy.dm index 9ab85d9828e..37706d325bf 100644 --- a/code/modules/clothing/shoes/cowboy.dm +++ b/code/modules/clothing/shoes/cowboy.dm @@ -20,7 +20,7 @@ /obj/item/clothing/shoes/cowboy/equipped(mob/living/carbon/user, slot) . = ..() RegisterSignal(user, COMSIG_LIVING_SLAM_TABLE, .proc/table_slam, override = TRUE) - if(slot == ITEM_SLOT_FEET) + if(slot & ITEM_SLOT_FEET) for(var/mob/living/occupant in contents) var/target_zone = user.get_random_valid_zone(blacklisted_parts = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM), even_weights = TRUE, bypass_warning = TRUE) if(!target_zone) //we broke their legs right on off! diff --git a/code/modules/clothing/shoes/gunboots.dm b/code/modules/clothing/shoes/gunboots.dm index 85c239c4b75..02220ec2b61 100644 --- a/code/modules/clothing/shoes/gunboots.dm +++ b/code/modules/clothing/shoes/gunboots.dm @@ -19,7 +19,7 @@ /obj/item/clothing/shoes/gunboots/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_FEET) + if(slot & ITEM_SLOT_FEET) RegisterSignal(user, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/check_kick) else UnregisterSignal(user, COMSIG_HUMAN_MELEE_UNARMED_ATTACK) diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 98b5aaa0e5a..f8df5dbe1c3 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -13,7 +13,7 @@ /obj/item/clothing/shoes/magboots/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_FEET) + if(slot & ITEM_SLOT_FEET) update_gravity_trait(user) else REMOVE_TRAIT(user, TRAIT_NEGATES_GRAVITY, type) diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index bf3cbbe26ce..0c82fcf3922 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -64,7 +64,7 @@ /// Start Processing on the space suit when it is worn to heat the wearer /obj/item/clothing/suit/space/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_OCLOTHING) // Check that the slot is valid + if(slot & ITEM_SLOT_OCLOTHING) // Check that the slot is valid START_PROCESSING(SSobj, src) update_hud_icon(user) // update the hud diff --git a/code/modules/clothing/suits/costume.dm b/code/modules/clothing/suits/costume.dm index a31d3f6ed9f..251cd2b1b7e 100644 --- a/code/modules/clothing/suits/costume.dm +++ b/code/modules/clothing/suits/costume.dm @@ -166,7 +166,7 @@ /obj/item/clothing/suit/costume/cardborg/equipped(mob/living/user, slot) ..() - if(slot == ITEM_SLOT_OCLOTHING) + if(slot & ITEM_SLOT_OCLOTHING) disguise(user) /obj/item/clothing/suit/costume/cardborg/dropped(mob/living/user) @@ -252,7 +252,7 @@ /obj/item/clothing/head/hooded/carp_hood/equipped(mob/living/carbon/human/user, slot) ..() - if (slot == ITEM_SLOT_HEAD) + if (slot & ITEM_SLOT_HEAD) user.faction |= "carp" /obj/item/clothing/head/hooded/carp_hood/dropped(mob/living/carbon/human/user) diff --git a/code/modules/clothing/suits/ethereal.dm b/code/modules/clothing/suits/ethereal.dm index 79d0811332c..f0e8ec19286 100644 --- a/code/modules/clothing/suits/ethereal.dm +++ b/code/modules/clothing/suits/ethereal.dm @@ -31,7 +31,7 @@ /obj/item/clothing/suit/hooded/ethereal_raincoat/trailwarden/equipped(mob/living/user, slot) . = ..() - if(isethereal(user) && slot == ITEM_SLOT_OCLOTHING) + if(isethereal(user) && (slot & ITEM_SLOT_OCLOTHING)) var/mob/living/carbon/human/ethereal = user to_chat(ethereal, span_notice("[src] gently quivers for a moment as you put it on.")) set_greyscale(ethereal.dna.species.fixed_mut_color) diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm index 358ba5a69b2..ddfd117771e 100644 --- a/code/modules/clothing/suits/toggles.dm +++ b/code/modules/clothing/suits/toggles.dm @@ -28,13 +28,13 @@ ToggleHood() /obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user) - if(slot == ITEM_SLOT_OCLOTHING) - return 1 + if(slot & ITEM_SLOT_OCLOTHING) + return TRUE /obj/item/clothing/suit/hooded/equipped(mob/user, slot) - if(slot != ITEM_SLOT_OCLOTHING) + if(!(slot & ITEM_SLOT_OCLOTHING)) RemoveHood() - ..() + return ..() /obj/item/clothing/suit/hooded/proc/RemoveHood() src.icon_state = "[initial(icon_state)]" @@ -97,7 +97,7 @@ /obj/item/clothing/head/hooded/equipped(mob/user, slot) ..() - if(slot != ITEM_SLOT_HEAD) + if(!(slot & ITEM_SLOT_HEAD)) if(suit) suit.RemoveHood() else diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 5e84c82fb65..c115e10064f 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -104,7 +104,7 @@ adjusted = DIGITIGRADE_STYLE H.update_worn_undersuit() - if(attached_accessory && slot != ITEM_SLOT_HANDS && ishuman(user)) + if(attached_accessory && !(slot & ITEM_SLOT_HANDS) && ishuman(user)) var/mob/living/carbon/human/H = user attached_accessory.on_uniform_equip(src, user) H.fan_hud_set_fandom() @@ -113,7 +113,7 @@ /obj/item/clothing/under/equipped(mob/living/user, slot) ..() - if(slot == ITEM_SLOT_ICLOTHING && freshly_laundered) + if((slot & ITEM_SLOT_ICLOTHING) && freshly_laundered) freshly_laundered = FALSE user.add_mood_event("fresh_laundry", /datum/mood_event/fresh_laundry) @@ -322,7 +322,7 @@ return adjusted = !adjusted if(adjusted) - if(female_sprite_flags != FEMALE_UNIFORM_TOP_ONLY) + if(!(female_sprite_flags & FEMALE_UNIFORM_TOP_ONLY)) female_sprite_flags = NO_FEMALE_UNIFORM if(!alt_covers_chest) // for the special snowflake suits that expose the chest when adjusted (and also the arms, realistically) body_parts_covered &= ~CHEST diff --git a/code/modules/clothing/under/ethereal.dm b/code/modules/clothing/under/ethereal.dm index 6361ab549de..d93302038a5 100644 --- a/code/modules/clothing/under/ethereal.dm +++ b/code/modules/clothing/under/ethereal.dm @@ -30,7 +30,7 @@ /obj/item/clothing/under/ethereal_tunic/trailwarden/equipped(mob/living/user, slot) . = ..() - if(isethereal(user) && slot == ITEM_SLOT_ICLOTHING) + if(isethereal(user) && (slot & ITEM_SLOT_ICLOTHING)) var/mob/living/carbon/human/ethereal = user to_chat(ethereal, span_notice("[src] gently quivers for a moment as you put it on.")) set_greyscale(ethereal.dna.species.fixed_mut_color) diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm index 2fc52508cbc..24d2a72376d 100644 --- a/code/modules/hydroponics/grown/flowers.dm +++ b/code/modules/hydroponics/grown/flowers.dm @@ -292,7 +292,7 @@ /obj/item/food/grown/rose/equipped(mob/user, slot, initial) . = ..() - if(slot == ITEM_SLOT_MASK) + if(slot & ITEM_SLOT_MASK) worn_icon_state = "[base_icon_state]_mouth" user.update_worn_mask() else diff --git a/code/modules/mining/equipment/kheiral_cuffs.dm b/code/modules/mining/equipment/kheiral_cuffs.dm index c6324af39c0..f53bde37f14 100644 --- a/code/modules/mining/equipment/kheiral_cuffs.dm +++ b/code/modules/mining/equipment/kheiral_cuffs.dm @@ -35,11 +35,11 @@ . += span_notice("The cuff's GPS signal is on.") /obj/item/kheiral_cuffs/item_action_slot_check(slot) - return slot == ITEM_SLOT_GLOVES + return (slot & ITEM_SLOT_GLOVES) /obj/item/kheiral_cuffs/equipped(mob/user, slot, initial) . = ..() - if(slot != ITEM_SLOT_GLOVES) + if(!(slot & ITEM_SLOT_GLOVES)) return on_wrist = TRUE playsound(loc, 'sound/weapons/handcuffs.ogg', 30, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) diff --git a/code/modules/mining/lavaland/tendril_loot.dm b/code/modules/mining/lavaland/tendril_loot.dm index d7dd174b1c0..c5e2ab598aa 100644 --- a/code/modules/mining/lavaland/tendril_loot.dm +++ b/code/modules/mining/lavaland/tendril_loot.dm @@ -131,7 +131,7 @@ var/mob/living/carbon/human/active_owner /obj/item/clothing/neck/necklace/memento_mori/item_action_slot_check(slot) - return slot == ITEM_SLOT_NECK + return (slot & ITEM_SLOT_NECK) /obj/item/clothing/neck/necklace/memento_mori/dropped(mob/user) ..() @@ -568,7 +568,7 @@ /obj/item/clothing/gloves/gauntlets/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_GLOVES) + if(slot & ITEM_SLOT_GLOVES) tool_behaviour = TOOL_MINING RegisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK, .proc/rocksmash) RegisterSignal(user, COMSIG_MOVABLE_BUMP, .proc/rocksmash) @@ -729,7 +729,7 @@ /obj/item/clothing/glasses/godeye/equipped(mob/living/user, slot) . = ..() - if(ishuman(user) && slot == ITEM_SLOT_EYES) + if(ishuman(user) && (slot & ITEM_SLOT_EYES)) ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT) pain(user) scan_ability.Grant(user) diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 2cc9bce9dee..5586fa59979 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -111,7 +111,7 @@ There are several things that need to be remembered: icon_file = MONKEY_UNIFORM_FILE //Female sprites have lower priority than digitigrade sprites - else if(dna.species.sexes && (dna.species.bodytype & BODYTYPE_HUMANOID) && physique == FEMALE && uniform.female_sprite_flags != NO_FEMALE_UNIFORM) //Agggggggghhhhh + else if(dna.species.sexes && (dna.species.bodytype & BODYTYPE_HUMANOID) && physique == FEMALE && !(uniform.female_sprite_flags & NO_FEMALE_UNIFORM)) //Agggggggghhhhh woman = TRUE if(!icon_exists(icon_file, RESOLVE_ICON_STATE(uniform))) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 7fd7a5a48b1..06822a3411b 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -828,9 +828,9 @@ GLOBAL_LIST_EMPTY(features_by_species) if(!(I.slot_flags & slot)) var/excused = FALSE // Anything that's small or smaller can fit into a pocket by default - if((slot == ITEM_SLOT_RPOCKET || slot == ITEM_SLOT_LPOCKET) && I.w_class <= WEIGHT_CLASS_SMALL) + if((slot & (ITEM_SLOT_RPOCKET|ITEM_SLOT_LPOCKET)) && I.w_class <= WEIGHT_CLASS_SMALL) excused = TRUE - else if(slot == ITEM_SLOT_SUITSTORE || slot == ITEM_SLOT_BACKPACK || slot == ITEM_SLOT_HANDS) + else if(slot & (ITEM_SLOT_SUITSTORE|ITEM_SLOT_BACKPACK|ITEM_SLOT_HANDS)) excused = TRUE if(!excused) return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/monkeys.dm b/code/modules/mob/living/carbon/human/species_types/monkeys.dm index 5d7abb4ab0e..1491c1672b0 100644 --- a/code/modules/mob/living/carbon/human/species_types/monkeys.dm +++ b/code/modules/mob/living/carbon/human/species_types/monkeys.dm @@ -231,6 +231,6 @@ var/mob/living/in_the_way_mob = crossed if(iscarbon(in_the_way_mob) && !in_the_way_mob.combat_mode) return - if(in_the_way_mob.pass_flags == PASSTABLE) + if(in_the_way_mob.pass_flags & PASSTABLE) return in_the_way_mob.knockOver(owner) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index f24136d4757..87515fd790e 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -43,7 +43,7 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real to_chat(user, span_warning("You can't reach the wiring!")) return - if(W.slot_flags & ITEM_SLOT_HEAD && hat_offset != INFINITY && !user.combat_mode && !is_type_in_typecache(W, GLOB.blacklisted_borg_hats)) + if((W.slot_flags & ITEM_SLOT_HEAD) && hat_offset != INFINITY && !user.combat_mode && !is_type_in_typecache(W, GLOB.blacklisted_borg_hats)) if(user == src) to_chat(user, span_notice("You can't seem to manage to place [W] on your head by yourself!") ) return @@ -68,7 +68,7 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real to_chat(user, span_warning("This defibrillator unit will not function on a deceased cyborg!")) return var/obj/item/defibrillator/D = W - if(D.slot_flags != ITEM_SLOT_BACK) //belt defibs need not apply + if(!(D.slot_flags & ITEM_SLOT_BACK)) //belt defibs need not apply to_chat(user, span_warning("This defibrillator unit doesn't seem to fit correctly!")) return if(D.cell) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm index bca18789ba8..fd186850e53 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/demonic_frost_miner.dm @@ -277,7 +277,7 @@ Difficulty: Extremely Hard /obj/item/clothing/shoes/winterboots/ice_boots/ice_trail/equipped(mob/user, slot) . = ..() - if(slot == ITEM_SLOT_FEET) + if(slot & ITEM_SLOT_FEET) ADD_TRAIT(src, TRAIT_NODROP, CURSED_ITEM_TRAIT(type)) /obj/item/clothing/shoes/winterboots/ice_boots/ice_trail/dropped(mob/user) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/brimdemon.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/brimdemon.dm index 9aacf4f3f26..51f30aee8de 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/brimdemon.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/brimdemon.dm @@ -220,7 +220,7 @@ /obj/item/ore_sensor/equipped(mob/user, slot, initial) . = ..() - if(slot == ITEM_SLOT_EARS) + if(slot & ITEM_SLOT_EARS) START_PROCESSING(SSobj, src) else STOP_PROCESSING(SSobj, src) diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index 5085d266f96..2baa588030c 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -240,7 +240,7 @@ /obj/item/mod/control/equipped(mob/user, slot) ..() - if(slot == slot_flags) + if(slot & slot_flags) set_wearer(user) else if(wearer) unset_wearer() @@ -252,7 +252,7 @@ clean_up() /obj/item/mod/control/item_action_slot_check(slot) - if(slot == slot_flags) + if(slot & slot_flags) return TRUE /obj/item/mod/control/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE) diff --git a/code/modules/modular_computers/file_system/programs/atmosscan.dm b/code/modules/modular_computers/file_system/programs/atmosscan.dm index c4867955ee1..3e86d542a27 100644 --- a/code/modules/modular_computers/file_system/programs/atmosscan.dm +++ b/code/modules/modular_computers/file_system/programs/atmosscan.dm @@ -57,7 +57,7 @@ var/list/data = get_header_data() var/turf/turf = get_turf(computer) data["atmozphereMode"] = atmozphere_mode - data["clickAtmozphereCompatible"] = computer.hardware_flag == PROGRAM_TABLET + data["clickAtmozphereCompatible"] = (computer.hardware_flag & PROGRAM_TABLET) switch (atmozphere_mode) //Null air wont cause errors, don't worry. if(ATMOZPHERE_SCAN_ENV) var/datum/gas_mixture/air = turf?.return_air() @@ -77,7 +77,7 @@ atmozphere_mode = ATMOZPHERE_SCAN_ENV UnregisterSignal(computer, COMSIG_ITEM_ATTACK_SELF_SECONDARY) return TRUE - if(computer.hardware_flag != PROGRAM_TABLET) + if(!(computer.hardware_flag & PROGRAM_TABLET)) computer.say("Device incompatible for scanning objects!") return FALSE atmozphere_mode = ATMOZPHERE_SCAN_CLICK diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 40255285be9..9c0c1f682bd 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -128,7 +128,7 @@ if (new_fax_name != fax_name) if (fax_name_exist(new_fax_name)) // Being able to set the same name as another fax machine will give a lot of gimmicks for the traitor. - if (syndicate_network != TRUE && obj_flags != EMAGGED) + if (syndicate_network != TRUE && !(obj_flags & EMAGGED)) to_chat(user, span_warning("There is already a fax machine with this name on the network.")) return TOOL_ACT_TOOLTYPE_SUCCESS user.log_message("renamed [fax_name] (fax machine) to [new_fax_name].", LOG_GAME) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 8f2bd065bce..e3742b76640 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -411,7 +411,7 @@ var/mob/living/carbon/human/stunned_human = stunned_mob if(istype(stunned_human.glasses, /obj/item/clothing/glasses/meson)) var/obj/item/clothing/glasses/meson/check_meson = stunned_human.glasses - if(check_meson.vision_flags == SEE_TURFS) + if(check_meson.vision_flags & SEE_TURFS) to_chat(stunned_human, span_notice("You look directly into the [name], good thing you had your protective eyewear on!")) continue diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index e29cb19e72d..f2df9aa2025 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -845,7 +845,7 @@ return FALSE //Yup, no reactions here. No siree. if(is_reacting)//Prevent wasteful calculations - if(datum_flags != DF_ISPROCESSING)//If we're reacting - but not processing (i.e. we've transfered) + if(!(datum_flags & DF_ISPROCESSING))//If we're reacting - but not processing (i.e. we've transfered) START_PROCESSING(SSreagents, src) if(!(has_changed_state())) return FALSE diff --git a/code/modules/reagents/reagent_containers/cups/_cup.dm b/code/modules/reagents/reagent_containers/cups/_cup.dm index 0836b3ef8b8..ba668dc30d5 100644 --- a/code/modules/reagents/reagent_containers/cups/_cup.dm +++ b/code/modules/reagents/reagent_containers/cups/_cup.dm @@ -356,7 +356,7 @@ /obj/item/reagent_containers/cup/bucket/equipped(mob/user, slot) . = ..() - if (slot == ITEM_SLOT_HEAD) + if (slot & ITEM_SLOT_HEAD) if(reagents.total_volume) to_chat(user, span_userdanger("[src]'s contents spill all over you!")) reagents.expose(user, TOUCH) diff --git a/code/modules/research/xenobiology/crossbreeding/_clothing.dm b/code/modules/research/xenobiology/crossbreeding/_clothing.dm index 2e8d8c5d6cd..d08507f1f66 100644 --- a/code/modules/research/xenobiology/crossbreeding/_clothing.dm +++ b/code/modules/research/xenobiology/crossbreeding/_clothing.dm @@ -19,7 +19,7 @@ Slimecrossing Armor /obj/item/clothing/mask/nobreath/equipped(mob/living/carbon/human/user, slot) . = ..() - if(slot == ITEM_SLOT_MASK) + if(slot & ITEM_SLOT_MASK) user.failed_last_breath = FALSE user.clear_alert(ALERT_NOT_ENOUGH_OXYGEN) user.apply_status_effect(/datum/status_effect/rebreathing) @@ -37,7 +37,7 @@ Slimecrossing Armor var/glasses_color = "#FFFFFF" /obj/item/clothing/glasses/prism_glasses/item_action_slot_check(slot) - if(slot == ITEM_SLOT_EYES) + if(slot & ITEM_SLOT_EYES) return TRUE /obj/structure/light_prism diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 2541fc3e0b9..4c285946bd3 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -254,7 +254,7 @@ /obj/item/surgical_processor/equipped(mob/user, slot, initial) . = ..() - if(slot != ITEM_SLOT_HANDS) + if(!(slot & ITEM_SLOT_HANDS)) UnregisterSignal(user, COMSIG_SURGERY_STARTING) return RegisterSignal(user, COMSIG_SURGERY_STARTING, .proc/check_surgery)