Refactors the mind.original variable into non reference variables. Improving player mob GC (#17219)

This commit is contained in:
Farie82
2021-12-16 18:30:21 +01:00
committed by GitHub
parent 6e1976f5cf
commit 8001f1ec04
14 changed files with 30 additions and 21 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ GLOBAL_VAR_INIT(sent_strike_team, 0)
R.real_name = R.name
R.mind = new
R.mind.current = R
R.mind.original = R
R.mind.set_original_mob(R)
R.mind.assigned_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
R.mind.offstation_role = TRUE
@@ -21,7 +21,7 @@
photosync()
to_chat(src, "<b>Laws synced with AI, be sure to note any changes.</b>")
// TODO: Update to new antagonist system.
if(mind && mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src)
if(mind && mind.special_role == SPECIAL_ROLE_TRAITOR && mind.is_original_mob(src))
to_chat(src, "<b>Remember, your AI does NOT share or know about your law 0.")
else
to_chat(src, "<b>No AI selected to sync laws with, disabling lawsync protocol.</b>")
@@ -30,7 +30,7 @@
to_chat(who, "<b>Obey these laws:</b>")
laws.show_laws(who)
// TODO: Update to new antagonist system.
if(mind && (mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src) && connected_ai)
if(mind && (mind.special_role == SPECIAL_ROLE_TRAITOR && mind.is_original_mob(src)) && connected_ai)
to_chat(who, "<b>Remember, [connected_ai.name] is technically your master, but your objective comes first.</b>")
else if(connected_ai)
to_chat(who, "<b>Remember, [connected_ai.name] is your master, other AIs can be ignored.</b>")
@@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
..()
add_robot_verbs()
// Remove inherited verbs that effectively do nothing for cyborgs, or lead to unintended behaviour.
verbs -= /mob/living/verb/lay_down
verbs -= /mob/living/verb/mob_sleep
@@ -1362,7 +1362,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
real_name = name
mind = new
mind.current = src
mind.original = src
mind.set_original_mob(src)
mind.assigned_role = SPECIAL_ROLE_ERT
mind.special_role = SPECIAL_ROLE_ERT
if(!(mind in SSticker.minds))
+2 -2
View File
@@ -457,8 +457,8 @@ GLOBAL_LIST_INIT(intents, list(INTENT_HELP,INTENT_DISARM,INTENT_GRAB,INTENT_HARM
var/realname = C.mob.real_name
if(C.mob.mind)
mindname = C.mob.mind.name
if(C.mob.mind.original && C.mob.mind.original.real_name)
realname = C.mob.mind.original.real_name
if(C.mob.mind.original_mob_name)
realname = C.mob.mind.original_mob_name
if(mindname && mindname != realname)
name = "[realname] died as [mindname]"
else
+1 -1
View File
@@ -550,7 +550,7 @@
else if(mind.assigned_role == "Mime")
new_character.real_name = pick(GLOB.mime_names)
new_character.rename_self("mime")
mind.original = new_character
mind.set_original_mob(new_character)
mind.transfer_to(new_character) //won't transfer key since the mind is not active
+2 -2
View File
@@ -28,7 +28,7 @@
if(mind)
mind.transfer_to(O)
O.mind.original = O
O.mind.set_original_mob(O)
else
O.key = key
@@ -81,7 +81,7 @@
if(mind) //TODO
mind.transfer_to(O)
if(O.mind.assigned_role == "Cyborg")
O.mind.original = O
O.mind.set_original_mob(O)
else if(mind && mind.special_role)
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
else
+1 -1
View File
@@ -174,7 +174,7 @@ GLOBAL_VAR_INIT(ert_request_answered, FALSE)
//Creates mind stuff.
M.mind = new
M.mind.current = M
M.mind.original = M
M.mind.set_original_mob(M)
M.mind.assigned_role = SPECIAL_ROLE_ERT
M.mind.special_role = SPECIAL_ROLE_ERT
M.mind.offstation_role = TRUE