mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-20 20:46:39 +01:00
26 lines
657 B
Plaintext
26 lines
657 B
Plaintext
//* This file is explicitly licensed under the MIT license. *//
|
|
//* Copyright (c) 2024 Citadel Station Developers *//
|
|
|
|
/**
|
|
* A layer of indirection to reference a mind.
|
|
*
|
|
* Useful for when you don't need a hard reference but say, a player cryos out.
|
|
*/
|
|
/datum/mind_ref
|
|
var/datum/mind/loaded
|
|
|
|
/datum/mind_ref/New(datum/mind/from_mind)
|
|
src.loaded = from_mind
|
|
|
|
/datum/mind_ref/Destroy(force)
|
|
if(!force)
|
|
STACK_TRACE("Tried to qdel a mind_ref; just toss its reference.")
|
|
return QDEL_HINT_LETMELIVE
|
|
if(loaded.mind_ref == src)
|
|
loaded.mind_ref = null
|
|
loaded = null
|
|
return ..()
|
|
|
|
/datum/mind_ref/proc/resolve() as /datum/mind
|
|
return loaded
|