mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
traitor runtime and gc fixes (#19616)
This commit is contained in:
+10
-4
@@ -76,7 +76,7 @@
|
||||
|
||||
/datum/mind/Destroy()
|
||||
SSticker.minds -= src
|
||||
QDEL_LIST(antag_datums)
|
||||
remove_all_antag_datums()
|
||||
current = null
|
||||
return ..()
|
||||
|
||||
@@ -1541,14 +1541,20 @@
|
||||
*/
|
||||
/datum/mind/proc/remove_antag_datum(datum_type)
|
||||
var/datum/antagonist/A = has_antag_datum(datum_type)
|
||||
LAZYREMOVE(antag_datums, A)
|
||||
qdel(A)
|
||||
|
||||
/**
|
||||
* Removes all antag datums from the src mind.
|
||||
*
|
||||
* Use this over doing `QDEL_LIST(antag_datums)`.
|
||||
*/
|
||||
/datum/mind/proc/remove_all_antag_datums() //For the Lazy amongst us.
|
||||
QDEL_LIST(antag_datums)
|
||||
/datum/mind/proc/remove_all_antag_datums()
|
||||
// This is not `QDEL_LIST(antag_datums)`because it's possible for the `antag_datums` list to be set to null during deletion of an antag datum.
|
||||
// Then `QDEL_LIST` would runtime because it would be doing `null.Cut()`.
|
||||
for(var/datum/antagonist/A as anything in antag_datums)
|
||||
qdel(A)
|
||||
antag_datums?.Cut()
|
||||
antag_datums = null
|
||||
|
||||
/// This proc sets the hijack speed for a mob. If greater than zero, they can hijack. Outputs in seconds.
|
||||
/datum/mind/proc/get_hijack_speed()
|
||||
|
||||
Reference in New Issue
Block a user