mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Refactors the mind.original variable into non reference variables. Improving player mob GC (#17219)
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
|
||||
|
||||
/mob/living/silicon/proc/sync_zeroth(datum/ai_law/zeroth_law, datum/ai_law/zeroth_law_borg)
|
||||
if(!is_special_character(src) || mind.original != src)
|
||||
if(!is_special_character(src) || !mind.is_original_mob(src))
|
||||
if(zeroth_law_borg)
|
||||
laws.set_zeroth_law(zeroth_law_borg.law)
|
||||
else if(zeroth_law)
|
||||
|
||||
+11
-2
@@ -23,7 +23,10 @@
|
||||
var/key
|
||||
var/name //replaces mob/var/original_name
|
||||
var/mob/living/current
|
||||
var/mob/living/original //TODO: remove.not used in any meaningful way ~Carn. First I'll need to tweak the way silicon-mobs handle minds.
|
||||
/// The original mob's UID. Used for example to see if a silicon with antag status is actually malf. Or just an antag put in a borg
|
||||
var/original_mob_UID
|
||||
/// The original mob's name. Used in Dchat messages
|
||||
var/original_mob_name
|
||||
var/active = 0
|
||||
|
||||
var/memory
|
||||
@@ -82,9 +85,15 @@
|
||||
qdel(i)
|
||||
antag_datums = null
|
||||
current = null
|
||||
original = null
|
||||
return ..()
|
||||
|
||||
/datum/mind/proc/set_original_mob(mob/original)
|
||||
original_mob_name = original.real_name
|
||||
original_mob_UID = original.UID()
|
||||
|
||||
/datum/mind/proc/is_original_mob(mob/M)
|
||||
return original_mob_UID == M.UID()
|
||||
|
||||
/datum/mind/proc/get_display_key()
|
||||
var/clientKey = current?.client?.get_display_key()
|
||||
return clientKey ? clientKey : key
|
||||
|
||||
Reference in New Issue
Block a user