From bb6771ebf560942eca5218abe84b936032da81af Mon Sep 17 00:00:00 2001 From: Pinta <68373373+softcerv@users.noreply.github.com> Date: Wed, 12 Apr 2023 22:33:15 -0400 Subject: [PATCH] [MODULAR] Admins can now delete NIFs and NIFs now remove after being broken for two shifts. (#20514) * Update nif_persistence.dm * Update nif_persistence.dm --- .../modules/modular_implants/code/nif_persistence.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modular_skyrat/modules/modular_implants/code/nif_persistence.dm b/modular_skyrat/modules/modular_implants/code/nif_persistence.dm index ed9bbdc0c6a..80ca9247d31 100644 --- a/modular_skyrat/modules/modular_implants/code/nif_persistence.dm +++ b/modular_skyrat/modules/modular_implants/code/nif_persistence.dm @@ -17,13 +17,19 @@ var/stored_rewards_points /// Saves the NIF data for a individual user. -/mob/living/carbon/human/proc/save_nif_data(datum/modular_persistence/persistence) +/mob/living/carbon/human/proc/save_nif_data(datum/modular_persistence/persistence, remove_nif = FALSE) var/obj/item/organ/internal/cyberimp/brain/nif/installed_nif = get_organ_by_type(/obj/item/organ/internal/cyberimp/brain/nif) if(HAS_TRAIT(src, GHOSTROLE_TRAIT)) //Nothing is lost from playing a ghost role return FALSE - if(!installed_nif || (installed_nif && !installed_nif.nif_persistence)) // If you have a NIF on file but leave the round without one installed, you only take a durability loss instead of losing the implant. + if(remove_nif) + qdel(installed_nif) + persistence.nif_path = null + persistence.nif_examine_text = null + return + + if(!installed_nif || (installed_nif && !installed_nif.nif_persistence) || (installed_nif.durability <= 0)) // If you have a NIF on file but leave the round without one installed, you only take a durability loss instead of losing the implant. if(persistence.nif_path) if(persistence.nif_durability <= 0) //There is one round to repair the NIF after it breaks, otherwise it will be lost. persistence.nif_path = null