From 3f0925af92958008a12031b427eb8998e6cb8d79 Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sat, 24 Jun 2023 07:22:56 -0700 Subject: [PATCH 1/2] Fix deterred crashsite offset --- code/modules/shuttle/dropship_hijack.dm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/code/modules/shuttle/dropship_hijack.dm b/code/modules/shuttle/dropship_hijack.dm index e664d0165c78..92df9f045db9 100644 --- a/code/modules/shuttle/dropship_hijack.dm +++ b/code/modules/shuttle/dropship_hijack.dm @@ -1,3 +1,5 @@ +#define HIJACK_CRASH_SITE_OFFSET_X -5 +#define HIJACK_CRASH_SITE_OFFSET_Y -11 /datum/dropship_hijack var/obj/docking_port/mobile/shuttle @@ -90,8 +92,8 @@ var/obj/docking_port/stationary/marine_dropship/crash_site/target_site = new() crash_site = target_site - crash_site.x = target.x - 5 - crash_site.y = target.y - 11 + crash_site.x = target.x + HIJACK_CRASH_SITE_OFFSET_X + crash_site.y = target.y + HIJACK_CRASH_SITE_OFFSET_Y crash_site.z = target.z target_site.name = "[shuttle] crash site" @@ -116,8 +118,10 @@ remaining_crash_sites -= target_ship_section var/new_target_ship_section = pick(remaining_crash_sites) var/turf/target = get_crashsite_turf(new_target_ship_section) - crash_site.Move(target) marine_announcement("A hostile aircraft on course for the [target_ship_section] has been successfully deterred.", "IX-50 MGAD System") + crash_site.x = target.x + HIJACK_CRASH_SITE_OFFSET_X + crash_site.y = target.y + HIJACK_CRASH_SITE_OFFSET_Y + crash_site.z = target.z target_ship_section = new_target_ship_section // TODO mobs not alerted for(var/area/internal_area in shuttle.shuttle_areas) @@ -218,3 +222,6 @@ else CRASH("Crash site [ship_section] unknown.") return pick(turfs) + +#undef HIJACK_CRASH_SITE_OFFSET_X +#undef HIJACK_CRASH_SITE_OFFSET_Y From a393c6d51e025f0eb6e3edabc220a774ee67fcaa Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sun, 25 Jun 2023 09:05:14 -0700 Subject: [PATCH 2/2] forceMove --- code/modules/shuttle/dropship_hijack.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/code/modules/shuttle/dropship_hijack.dm b/code/modules/shuttle/dropship_hijack.dm index 92df9f045db9..35009ad42485 100644 --- a/code/modules/shuttle/dropship_hijack.dm +++ b/code/modules/shuttle/dropship_hijack.dm @@ -92,9 +92,10 @@ var/obj/docking_port/stationary/marine_dropship/crash_site/target_site = new() crash_site = target_site - crash_site.x = target.x + HIJACK_CRASH_SITE_OFFSET_X - crash_site.y = target.y + HIJACK_CRASH_SITE_OFFSET_Y - crash_site.z = target.z + var/turf/offset_target = locate(target.x + HIJACK_CRASH_SITE_OFFSET_X, target.y + HIJACK_CRASH_SITE_OFFSET_Y, target.z) + if(!offset_target) + offset_target = target // Welp the offsetting failed so... + target_site.forceMove(offset_target) target_site.name = "[shuttle] crash site" target_site.id = "crash_site_[shuttle.id]" @@ -118,10 +119,11 @@ remaining_crash_sites -= target_ship_section var/new_target_ship_section = pick(remaining_crash_sites) var/turf/target = get_crashsite_turf(new_target_ship_section) + var/turf/offset_target = locate(target.x + HIJACK_CRASH_SITE_OFFSET_X, target.y + HIJACK_CRASH_SITE_OFFSET_Y, target.z) + if(!offset_target) + offset_target = target // Welp the offsetting failed so... + crash_site.forceMove(offset_target) marine_announcement("A hostile aircraft on course for the [target_ship_section] has been successfully deterred.", "IX-50 MGAD System") - crash_site.x = target.x + HIJACK_CRASH_SITE_OFFSET_X - crash_site.y = target.y + HIJACK_CRASH_SITE_OFFSET_Y - crash_site.z = target.z target_ship_section = new_target_ship_section // TODO mobs not alerted for(var/area/internal_area in shuttle.shuttle_areas)