diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index a64bd4d1c37..7cee1b6541c 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -269,8 +269,12 @@ AddElement(/datum/element/hostile_machine) /obj/vehicle/sealed/mecha/Destroy() - for(var/ejectee in occupants) - mob_exit(ejectee, silent = TRUE) + /// If the former occupants get polymorphed, mutated, chestburstered, + /// or otherwise replaced by another mob, that mob is no longer in .occupants + /// and gets deleted with the mech. However, they do remain in .contents + var/list/potential_occupants = contents ^ occupants + for(var/mob/buggy_ejectee in potential_occupants) + mob_exit(buggy_ejectee, silent = TRUE) if(LAZYLEN(flat_equipment)) for(var/obj/item/mecha_parts/mecha_equipment/equip as anything in flat_equipment) diff --git a/code/modules/vehicles/mecha/mecha_mob_interaction.dm b/code/modules/vehicles/mecha/mecha_mob_interaction.dm index e9d7f5a1e1f..7accab008f1 100644 --- a/code/modules/vehicles/mecha/mecha_mob_interaction.dm +++ b/code/modules/vehicles/mecha/mecha_mob_interaction.dm @@ -139,6 +139,8 @@ mob_container = AI newloc = get_turf(AI.linked_core) qdel(AI.linked_core) + else if(isliving(M)) + mob_container = M else return ..() var/mob/living/ejector = M