From 4c46ee067669912dbefa884714214bbfa248550f Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Fri, 5 Dec 2025 07:48:04 -0600 Subject: [PATCH] Fix bola slowing when held (#94335) ## About The Pull Request We just deleted the code that read `SLOWS_WHILE_IN_HAND` ## Changelog :cl: Melbert fix: Bolas don't slow while in hand /:cl: --- code/modules/mob/inventory.dm | 6 ++++-- code/modules/unit_tests/_unit_tests.dm | 1 + code/modules/unit_tests/held_slowdown.dm | 11 +++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 code/modules/unit_tests/held_slowdown.dm diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 53f312ccdc6..c3d55e7167b 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -475,8 +475,10 @@ ///Get all items in our possession that should affect our movespeed /mob/proc/get_equipped_speed_mod_items() - return get_equipped_items(INCLUDE_HELD|INCLUDE_ABSTRACT|INCLUDE_PROSTHETICS) - + . = get_equipped_items(INCLUDE_ABSTRACT|INCLUDE_PROSTHETICS) + for(var/obj/item/thing in held_items) + if(thing.item_flags & SLOWS_WHILE_IN_HAND) + . += thing /** * Returns the items that were successfully unequipped. */ diff --git a/code/modules/unit_tests/_unit_tests.dm b/code/modules/unit_tests/_unit_tests.dm index 54a6f1db363..2ef6664a605 100644 --- a/code/modules/unit_tests/_unit_tests.dm +++ b/code/modules/unit_tests/_unit_tests.dm @@ -177,6 +177,7 @@ #include "gloves_and_shoes_armor.dm" #include "greyscale_config.dm" #include "hallucination_icons.dm" +#include "held_slowdown.dm" #include "heretic_knowledge.dm" #include "heretic_rituals.dm" #include "high_five.dm" diff --git a/code/modules/unit_tests/held_slowdown.dm b/code/modules/unit_tests/held_slowdown.dm new file mode 100644 index 00000000000..0dbacd51246 --- /dev/null +++ b/code/modules/unit_tests/held_slowdown.dm @@ -0,0 +1,11 @@ +/// Tests SLOWS_WHILE_IN_HAND +/datum/unit_test/held_slowdown + +/datum/unit_test/held_slowdown/Run() + var/mob/living/carbon/human/consistent/dummy = EASY_ALLOCATE() + var/obj/item/restraints/legcuffs/bola/bola = EASY_ALLOCATE() + dummy.put_in_hands(bola) + TEST_ASSERT(!(bola in dummy.get_equipped_speed_mod_items()), "Bola slows while held, when it shouldn't.") + + bola.item_flags |= SLOWS_WHILE_IN_HAND + TEST_ASSERT((bola in dummy.get_equipped_speed_mod_items()), "Bola should slow while held now that it has the SLOWS_WHILE_IN_HAND flag.")