Skip to content

Inserting a brain into an IPC that revives from insertion sends brain to nullspace #5956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ziiro opened this issue Mar 16, 2025 · 1 comment

Comments

@Ziiro
Copy link
Contributor

Ziiro commented Mar 16, 2025

Round ID:

Testmerges:

Reproduction:

I found this while working on #5781 - but it happens in live currently.

  1. Damage an IPC enough to kill it
  2. Surgically remove the brain from the chest
  3. Repair the brainless IPC up to full
  4. Re-insert the posibrain
  5. IPC brain client is sent to the nullspace area until spec_revival completes (9 seconds)

Image

Some of my findings so far:

Here's where an IPC is revived on brain insertion

/obj/item/organ/internal/brain/synth/on_insert(mob/living/carbon/brain_owner)
. = ..()
if(brain_owner.stat != DEAD || !ishuman(brain_owner))
return
var/mob/living/carbon/human/user_human = brain_owner
if(HAS_TRAIT(user_human, TRAIT_REVIVES_BY_HEALING) && user_human.health > SYNTH_BRAIN_WAKE_THRESHOLD)
if(!HAS_TRAIT(user_human, TRAIT_DEFIB_BLACKLISTED))
user_human.revive(FALSE)

And here's the spec_revival that it has to run through before it finishes the transfer to the body:

/datum/species/ipc/spec_revival(mob/living/carbon/human/H)
H.notify_ghost_cloning("You have been repaired!")
H.grab_ghost()
H.dna.features["ipc_screen"] = "BSOD"
H.update_body()
playsound(H, 'monkestation/sound/voice/dialup.ogg', 25)
H.say("Reactivating [pick("core systems", "central subroutines", "key functions")]...")
sleep(3 SECONDS)
if(H.stat == DEAD)
return
H.say("Reinitializing [pick("personality matrix", "behavior logic", "morality subsystems")]...")
sleep(3 SECONDS)
if(H.stat == DEAD)
return
H.say("Finalizing setup...")
sleep(3 SECONDS)
if(H.stat == DEAD)
return
H.say("Unit [H.real_name] is fully functional. Have a nice day.")
switch_to_screen(H, "Console")
addtimer(CALLBACK(src, PROC_REF(switch_to_screen), H, saved_screen), 5 SECONDS)
playsound(H.loc, 'sound/machines/chime.ogg', 50, TRUE)
H.visible_message(span_notice("[H]'s [change_screen ? "monitor lights up" : "eyes flicker to life"]!"), span_notice("All systems nominal. You're back online!"))
return

I'm not sure why the revive is waiting until the spec_revival is complete, as the order of operations should function better than that:

/mob/living/carbon/human/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE)
if(..())
if(dna && dna.species)
dna.species.spec_revival(src)

@Ziiro
Copy link
Contributor Author

Ziiro commented Mar 18, 2025

additionally:

/datum/surgery_step/finalize_positronic_restoration/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(HAS_TRAIT(target, TRAIT_DEFIB_BLACKLISTED))
target.emote("buzz")
target.visible_message(span_warning("...[target.p_they()] convulses, then goes offline."))
return TRUE
if (target.stat < DEAD)
target.visible_message(span_notice("...[target] is completely unaffected! Seems like they're already active!"))
return FALSE
target.cure_husk()
target.grab_ghost()
target.updatehealth()
if(target.revive())
target.emote("chime")
target.visible_message(span_notice("...[target] reactivates, their chassis coming online!"))
return FALSE //This is due to synths having some weirdness with their revive.
else
target.emote("buzz")
target.visible_message(span_warning("...[target.p_they()] convulses, then goes offline."))
return TRUE

The failure message on 111 gets triggered even on a success. Still trying to find out why this is running twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant