From 53d2b4171197fc2f68f90171fd7e507f93a5feab Mon Sep 17 00:00:00 2001 From: Time-Green <7501474+Time-Green@users.noreply.github.com> Date: Tue, 12 Dec 2023 23:51:08 +0100 Subject: [PATCH] [NO-GBP] Fixes highlander gibbing the whole server (#80263) Highlander was just deleting or dropping everything, including your bodyparts and organs :cl: fix: Highlander wont gib every person anymore /:cl: --- code/modules/admin/verbs/admin.dm | 10 ++-------- code/modules/antagonists/highlander/highlander.dm | 5 ++--- code/modules/mob/inventory.dm | 15 +++++++++++++-- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index 1c0bd7806db..6ceb61d9d6d 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -174,14 +174,8 @@ if(confirm != "Yes") return - for(var/obj/item/W in M) - if(!M.dropItemToGround(W)) - // I hate that this is necessary, but the code is literally just dropping or deleting everything otherwise - // people should be allowed to keep their fucking organs - if(istype(W, /obj/item/organ) || istype(W, /obj/item/bodypart)) - continue - qdel(W) - M.regenerate_icons() + M.drop_everything(del_on_drop = FALSE, force = TRUE, del_if_nodrop = TRUE) + M.regenerate_icons() log_admin("[key_name(usr)] made [key_name(M)] drop everything!") var/msg = "[key_name_admin(usr)] made [ADMIN_LOOKUPFLW(M)] drop everything!" diff --git a/code/modules/antagonists/highlander/highlander.dm b/code/modules/antagonists/highlander/highlander.dm index 98659ef1941..077bd2158b8 100644 --- a/code/modules/antagonists/highlander/highlander.dm +++ b/code/modules/antagonists/highlander/highlander.dm @@ -52,9 +52,8 @@ if(!istype(H)) return - for(var/obj/item/I in H) - if(!H.dropItemToGround(I)) - qdel(I) + H.drop_everything(del_on_drop = FALSE, force = TRUE, del_if_nodrop = TRUE) + H.regenerate_icons() H.revive(ADMIN_HEAL_ALL) H.equip_to_slot_or_del(new /obj/item/clothing/under/costume/kilt/highlander(H), ITEM_SLOT_ICLOTHING) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 139218e4572..219d8e357e7 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -485,6 +485,19 @@ DEFAULT_QUEUE_OR_CALL_VERB(VERB_CALLBACK(src, PROC_REF(execute_quick_equip))) +/// Safely drop everything, without deconstructing the mob +/mob/proc/drop_everything(del_on_drop, force, del_if_nodrop) + . = list() + for(var/obj/item/item in src) + if(!dropItemToGround(item, force)) + if(del_if_nodrop && !(item.item_flags & ABSTRACT)) + qdel(item) + if(del_on_drop) + qdel(item) + //Anything thats not deleted and isn't in the mob, so everything that is succesfully dropped to the ground, is returned + if(!QDELETED(item) && !(item in src)) + . += item + ///proc extender of [/mob/verb/quick_equip] used to make the verb queuable if the server is overloaded /mob/proc/execute_quick_equip() var/obj/item/I = get_active_held_item() @@ -505,8 +518,6 @@ /mob/proc/getBeltSlot() return ITEM_SLOT_BELT - - //Inventory.dm is -kind of- an ok place for this I guess //This is NOT for dismemberment, as the user still technically has 2 "hands"