(Partially) Fixes Out Of Memory crashes (#17043)

* Fixes massive memory leak

* Brain Runtime Fix

* There was no reason for this to be a spawn(0)

And no I didn't spawn with no blood - https://i.imgur.com/vPizqCD.png

* Fixes deadringer not properly deathgasping the right entity

* Wounds properly get delted off destroyed limbs

* Update vorestation.dme

* Runtime fix & DNA lock fix

* More qdels

* qdel

* comment out
This commit is contained in:
Cameron Lennox
2025-02-05 14:02:17 -05:00
committed by GitHub
parent f43b7a1d88
commit 2e4f1ce642
30 changed files with 126 additions and 69 deletions
+9 -8
View File
@@ -12,19 +12,21 @@
var/controller_lock = 0 //whether or not the gun is locked by the primar controller, 0 or 1, at 1 it is locked and does not allow
var/exploding = 0
/obj/item/dnalockingchip/Destroy(force, ...)
. = ..()
/obj/item/gun/proc/get_dna(mob/user)
var/mob/living/M = user
if(!attached_lock.controller_lock)
if(!attached_lock.stored_dna && !(M.dna in attached_lock.stored_dna))
if(attached_lock.stored_dna && (M.dna.unique_enzymes in attached_lock.stored_dna))
to_chat(M, span_warning("\The [src] buzzes and displays a symbol showing the gun already contains your DNA."))
return 0
else
attached_lock.stored_dna += M.dna
attached_lock.stored_dna += M.dna.unique_enzymes
to_chat(M, span_notice("\The [src] pings and a needle flicks out from the grip, taking a DNA sample from you."))
if(!attached_lock.controller_dna)
attached_lock.controller_dna = M.dna
attached_lock.controller_dna = M.dna.unique_enzymes
to_chat(M, span_notice("\The [src] processes the dna sample and pings, acknowledging you as the primary controller."))
return 1
else
@@ -44,10 +46,9 @@
to_chat(M, span_warning("\The [src] buzzes and displays an invalid user symbol."))
return 0
else
attached_lock.stored_dna -= user.dna
attached_lock.stored_dna -= user.dna.unique_enzymes
to_chat(M, span_notice("\The [src] beeps and clears the DNA it has stored."))
if(M.dna == attached_lock.controller_dna)
attached_lock.controller_dna = null
if(M.dna.unique_enzymes == attached_lock.controller_dna)
to_chat(M, span_notice("\The [src] beeps and removes you as the primary controller."))
if(attached_lock.controller_lock)
attached_lock.controller_lock = 0
@@ -64,7 +65,7 @@
/obj/item/gun/proc/toggledna(mob/user)
var/mob/living/M = user
if(authorized_user(M) && user.dna == attached_lock.controller_dna)
if(authorized_user(M) && user.dna.unique_enzymes == attached_lock.controller_dna)
if(!attached_lock.controller_lock)
attached_lock.controller_lock = 1
to_chat(M, span_notice("\The [src] beeps and displays a locked symbol, informing you it will no longer allow DNA samples."))
@@ -83,6 +84,6 @@
/obj/item/gun/proc/authorized_user(mob/user)
if(!attached_lock.stored_dna || !attached_lock.stored_dna.len)
return 1
if(!(user.dna in attached_lock.stored_dna))
if(!(user.dna.unique_enzymes in attached_lock.stored_dna))
return 0
return 1