Reviving while a clone is "baking" causes the clone to fail

This commit is contained in:
Crazylemon64
2017-06-04 04:14:16 -07:00
parent e3b6f79920
commit ebadfa8276
5 changed files with 98 additions and 13 deletions
+57
View File
@@ -59,6 +59,13 @@
//Override this for content
/datum/soullink/proc/sharerDies(gibbed, mob/living/owner)
//Runs after /living update_revive()
//Override this for content
/datum/soullink/proc/ownerRevives(mob/living/owner)
//Runs after /living update_revive()
//Override this for content
/datum/soullink/proc/sharerRevives(mob/living/owner)
//Quick-use helper
/proc/soullink(typepath, ...)
@@ -155,3 +162,53 @@
//Lose your claim to the throne!
/datum/soullink/multisharer/replacementpool/sharerDies(gibbed, mob/living/sharer)
removeSoulsharer(sharer)
////////////////
// SOUL HOOK //
////////////////
// When the owner transitions from dead to alive or vice versa,
// the linked atom is notified
// Atoms that actually utilize this system are responsible for handling the GC cleanup themselves
// Splashing the GC handling onto every atom would be a big old waste
/datum/soullink/soulhook
var/atom/movable/otherend
/datum/soullink/soulhook/Destroy()
if(otherend)
LAZYREMOVE(otherend.sharedSoulhooks, src)
otherend = null
return ..()
/datum/soullink/soulhook/parseArgs(mob/living/owner, atom/movable/other)
if(!owner || !other)
return FALSE
soulowner = owner
otherend = other
LAZYADD(owner.ownedSoullinks, src)
LAZYADD(other.sharedSoulhooks, src)
return TRUE
/datum/soullink/soulhook/ownerDies(gibbed, mob/living/owner)
if(otherend)
otherend.onSoullinkDeath(gibbed, owner)
/datum/soullink/soulhook/ownerRevives(mob/living/owner)
if(otherend)
otherend.onSoullinkRevive(owner)
// oops I'm butchering the application of this
/datum/soullink/soulhook/removeSoulsharer(atom/movable/other)
if(otherend == other)
otherend = null
LAZYREMOVE(other.sharedSoulhooks, src)
qdel(src) // not much point in a soul link with one end out of the picture for good
/atom/movable
var/list/sharedSoulhooks = null
/atom/movable/proc/onSoullinkDeath(gibbed, mob/living/owner)
/atom/movable/proc/onSoullinkRevive(mob/living/owner)