Small fix to recent Posibrain changes (#5908)

## About The Pull Request

Quick PR to fix a oversight and a few bugs, thanks artur.

## Why It's Good For The Game

Oversight and bug fix = good

## Proof Of Testing

works on my machine

## Changelog

🆑
fix: Fixes your brain falling out as a synth when choosing circuit or
MMI
/🆑

---------

Co-authored-by: Artur Lang <24881678+Arturlang@users.noreply.github.com>
This commit is contained in:
Vanilla1040
2026-07-07 12:03:46 +02:00
committed by GitHub
co-authored by Artur Lang
parent dafce56eb8
commit e962965c1b
2 changed files with 27 additions and 12 deletions
@@ -205,8 +205,12 @@
/datum/surgery_operation/limb/organ_manipulation/proc/on_success_insert_organ(obj/item/bodypart/limb, mob/living/surgeon, obj/item/organ/organ)
//Bubber Edit Start, Checks if the type attempted to be inserted is a positronic or not
if(istype(organ, /obj/item/mmi/posibrain))
if(istype(organ, /obj/item/mmi))
organ = new /obj/item/organ/brain/synth/mmi(null, organ)
else if(istype(organ, /obj/item/mmi/posibrain))
organ = new /obj/item/organ/brain/synth(null, organ)
else if(istype(organ, /obj/item/mmi/posibrain/circuit))
organ = new /obj/item/organ/brain/synth/circuit(null, organ)
//Bubber Edit End
surgeon.temporarilyRemoveItemFromInventory(organ, TRUE)
organ.pre_surgical_insertion(surgeon, limb, limb.body_zone)
@@ -13,7 +13,7 @@
actions_types = list(/datum/action/item_action/synth/open_internal_computer)
organ_traits = list(TRAIT_SILICON_EMOTES_ALLOWED)
var/mmi_type = /obj/item/mmi/posibrain
var/obj/item/mmi/posibrain/stored_mmi
var/obj/item/mmi/stored_mmi
/obj/item/organ/brain/synth/Initialize(mapload, obj/item/mmi/brain_mmi)
. = ..()
@@ -31,13 +31,24 @@
. = ..()
/obj/item/organ/brain/synth/Remove(mob/living/carbon/organ_owner, special = FALSE, movement_flags)
var/atom/drop_target = organ_owner ? organ_owner.drop_location() : drop_location()
. = ..()
if(istype(stored_mmi))
stored_mmi.forceMove(drop_target)
stored_mmi = null
if(!QDELING(src))
qdel(src)
if(!istype(stored_mmi) || special)
return
stored_mmi.brain = src
organ_flags |= ORGAN_FROZEN
stored_mmi.update_appearance()
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(nest_into_stored_mmi))
/obj/item/organ/brain/synth/proc/nest_into_stored_mmi(datum/source, atom/old_loc, dir, forced)
SIGNAL_HANDLER
if(loc == stored_mmi)
return
var/obj/item/mmi/mmi = stored_mmi
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
stored_mmi = null
var/atom/destination = loc || mmi.drop_location()
mmi.forceMove(destination)
forceMove(mmi)
/obj/item/organ/brain/synth/on_mob_insert(mob/living/carbon/brain_owner, special, movement_flags = NO_ID_TRANSFER)
. = ..()
@@ -145,8 +156,8 @@
mmi_type = /obj/item/mmi/posibrain/circuit
/obj/item/organ/brain/synth/mmi
name = "compact man-machine interface"
desc = "A compact man-machine interface, It is usually slotted into the chest of synthetic crewmembers."
icon = 'modular_skyrat/master_files/icons/obj/surgery.dmi'
icon_state = "mmi-ipc"
name = "augmented brain"
desc = "A augmented organic brain"
icon = /obj/item/organ/brain::icon
icon_state = "brain"
mmi_type = /obj/item/mmi