From edc0a30893ddaaa07fbf70e806c6745cf075b45e Mon Sep 17 00:00:00 2001 From: jimmyl <70376633+mc-oofert@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:44:49 +0100 Subject: [PATCH] MMIs in an odysseus get the medhud, medical beamgun works properly (#88891) --- .../projectiles/guns/special/medbeam.dm | 2 +- .../mecha/equipment/tools/medical_tools.dm | 2 +- .../modules/vehicles/mecha/medical/odysseus.dm | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/code/modules/projectiles/guns/special/medbeam.dm b/code/modules/projectiles/guns/special/medbeam.dm index 95da571baf5..b317a8ddabf 100644 --- a/code/modules/projectiles/guns/special/medbeam.dm +++ b/code/modules/projectiles/guns/special/medbeam.dm @@ -83,7 +83,7 @@ last_check = world.time - if(!los_check(loc, current_target, mid_check = CALLBACK(src, PROC_REF(mid_los_check)))) + if(!los_check(get_atom_on_turf(src), current_target, mid_check = CALLBACK(src, PROC_REF(mid_los_check)))) QDEL_NULL(current_beam)//this will give the target lost message return diff --git a/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm b/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm index 3c49e18c755..6a11ace4f62 100644 --- a/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm @@ -395,7 +395,7 @@ /obj/item/mecha_parts/mecha_equipment/medical/mechmedbeam/process(deltatime) . = ..() - if(.) + if(. || !length(chassis.occupants)) return if(chassis.weapons_safety) medigun.LoseTarget() diff --git a/code/modules/vehicles/mecha/medical/odysseus.dm b/code/modules/vehicles/mecha/medical/odysseus.dm index 162858bc310..e6f02e2710b 100644 --- a/code/modules/vehicles/mecha/medical/odysseus.dm +++ b/code/modules/vehicles/mecha/medical/odysseus.dm @@ -12,17 +12,17 @@ accesses = list(ACCESS_MECH_SCIENCE, ACCESS_MECH_MEDICAL) pivot_step = TRUE -/obj/vehicle/sealed/mecha/odysseus/moved_inside(mob/living/carbon/human/H) +/obj/vehicle/sealed/mecha/odysseus/moved_inside(mob/living/carbon/human/human) . = ..() - if(. && !HAS_TRAIT(H, TRAIT_MEDICAL_HUD)) - ADD_TRAIT(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) + if(. && !HAS_TRAIT(human, TRAIT_MEDICAL_HUD)) + ADD_TRAIT(human, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) -/obj/vehicle/sealed/mecha/odysseus/remove_occupant(mob/living/carbon/human/H) - if(isliving(H) && HAS_TRAIT_FROM(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT)) - REMOVE_TRAIT(H, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) +/obj/vehicle/sealed/mecha/odysseus/remove_occupant(mob/living/carbon/human/human) + if(isliving(human) && HAS_TRAIT_FROM(human, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT)) + REMOVE_TRAIT(human, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) return ..() -/obj/vehicle/sealed/mecha/odysseus/mmi_moved_inside(obj/item/mmi/M, mob/user) +/obj/vehicle/sealed/mecha/odysseus/mmi_moved_inside(obj/item/mmi/MMI, mob/user) . = ..() - if(. && !HAS_TRAIT(M, TRAIT_MEDICAL_HUD)) - ADD_TRAIT(M, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT) + if(. && !isnull(MMI.brainmob) && !HAS_TRAIT(MMI.brainmob, TRAIT_MEDICAL_HUD)) + ADD_TRAIT(MMI.brainmob, TRAIT_MEDICAL_HUD, VEHICLE_TRAIT)