diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index cbbc702adf..5d01416785 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -72,7 +72,7 @@ var/obj/item/projectile/P = A P.dispersion = deviation process_accuracy(P, chassis.occupant, target) - P.launch_projectile_from_turf(target, chassis.occupant.zone_sel.selecting, chassis.occupant, params) + P.launch_projectile_from_turf(target, chassis.get_pilot_zone_sel(), chassis.occupant, params) else if(istype(A, /atom/movable)) var/atom/movable/AM = A AM.throw_at(target, 7, 1, chassis) diff --git a/code/game/mecha/mecha_helpers.dm b/code/game/mecha/mecha_helpers.dm new file mode 100644 index 0000000000..f916e19f6f --- /dev/null +++ b/code/game/mecha/mecha_helpers.dm @@ -0,0 +1,11 @@ +/* + * Helper file for Exosuit / Mecha code. + */ + +// Returns, at least, a usable target body position, for things like guns. + +/obj/mecha/proc/get_pilot_zone_sel() + if(!occupant || !occupant.zone_sel || occupant.stat) + return BP_TORSO + + return occupant.zone_sel.selecting diff --git a/polaris.dme b/polaris.dme index e11ab0e724..78ade1f269 100644 --- a/polaris.dme +++ b/polaris.dme @@ -783,6 +783,7 @@ #include "code\game\mecha\mecha.dm" #include "code\game\mecha\mecha_construction_paths.dm" #include "code\game\mecha\mecha_control_console.dm" +#include "code\game\mecha\mecha_helpers.dm" #include "code\game\mecha\mecha_parts.dm" #include "code\game\mecha\mecha_wreckage.dm" #include "code\game\mecha\combat\combat.dm"