Fixes runtime in golem body swap, Fixes some hard deletes assocaited with golems and mind masters (#73373)

## About The Pull Request

Fixes #73368 

Golems didn't mind transfer on body swap until after the body was
finished creating, this created an issue as golems also did mind
assignment business while creating the body. So the
`mind.enslave_to_creator()` part runtime error'd and caused the create
to fail, which in turn caused the shell to not be consumed.

While sorting this out, I noticed that shells and golems hold a hard
reference to their owner. Yep, hard deletes. Changes mind `enslaved_to`
to a weakref, changes golem `owner` to a weakref, straight up removes
golem `owner` tracking on species because it was ONLY used for card
board golems when it could've just grabbed mind master

## Why It's Good For The Game

No more infinite golem shells

## Changelog

🆑 Melbert
fix: Transferring golem shells no longer make you a free man and also
results in infinite golem shells
fix: Servant golems are considerably less free
fix: Fixes some hard deletes related to mob minds being enslaved to
other mobs
/🆑
This commit is contained in:
MrMelbert
2023-02-17 15:06:49 -07:00
committed by GitHub
parent 75e5a0a5cb
commit e8d209c6f4
8 changed files with 87 additions and 65 deletions
+3 -2
View File
@@ -62,8 +62,9 @@
var/datum/atom_hud/alternate_appearance/basic/antagonist_hud/antag_hud = null
var/holy_role = NONE //is this person a chaplain or admin role allowed to use bibles, Any rank besides 'NONE' allows for this.
///If this mind's master is another mob (i.e. adamantine golems)
var/mob/living/enslaved_to
///If this mind's master is another mob (i.e. adamantine golems). Weakref of a /living.
var/datum/weakref/enslaved_to
var/datum/language_holder/language_holder
var/unconvertable = FALSE
var/late_joiner = FALSE
+1 -1
View File
@@ -211,7 +211,7 @@
add_antag_datum(N,converter.nuke_team)
enslaved_to = creator
enslaved_to = WEAKREF(creator)
current.faction |= creator.faction
creator.faction |= current.faction