[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
This commit is contained in:
Pinta
2023-04-13 03:33:15 +01:00
committed by GitHub
parent 87db5874ef
commit bb6771ebf5
@@ -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