Skip to content

Commit

Permalink
Fix Deterred Crashsite Offset (#3717)
Browse files Browse the repository at this point in the history
# About the pull request

This PR fixes an oversight where a deterred crashsite does not get
positioned the same as a non-deterred one.

# Explain why it's good for the game

Fixes #3593 or atleast should much better mitigate it making it so a
deterred crashsite positions the same as a non-deterred.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

# Changelog
:cl: Drathek
fix: Fixed the crashsite offset for a hijack shuttle that gets deterred
by the MGAD System
/:cl:
  • Loading branch information
Drulikar committed Jun 28, 2023
1 parent b710769 commit 49c7c01
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions code/modules/shuttle/dropship_hijack.dm
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -90,9 +92,10 @@

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.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]"
Expand All @@ -116,7 +119,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)
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")
target_ship_section = new_target_ship_section
// TODO mobs not alerted
Expand Down Expand Up @@ -218,3 +224,6 @@
else
CRASH("Crash site [ship_section] unknown.")
return pick(turfs)

#undef HIJACK_CRASH_SITE_OFFSET_X
#undef HIJACK_CRASH_SITE_OFFSET_Y

0 comments on commit 49c7c01

Please sign in to comment.