Skip to content

Commit

Permalink
Prevents shuttle from moving if there is no destination. (#7991)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karolis2011 authored and NonQueueingMatt committed Jan 12, 2020
1 parent 2d0ba51 commit 204b161
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
#define SHUTTLE_IDLE 0
#define SHUTTLE_WARMUP 1
#define SHUTTLE_INTRANSIT 2
#define SHUTTLE_HALT 3 // State of no recovery

// Ferry shuttle processing status.
#define IDLE_STATE 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/overmap/ships/computers/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
if(SHUTTLE_HALT) shuttle_state = "halt"

var/shuttle_status
switch (shuttle.process_state)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/shuttles/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
if(origin == destination)
return

if(!origin.contents.len || !destination.contents.len)
return

if (docking_controller && !docking_controller.undocked())
docking_controller.force_undock()

Expand Down
1 change: 1 addition & 0 deletions code/modules/shuttles/shuttle_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
if(SHUTTLE_HALT) shuttle_state = "halt"

var/shuttle_status
switch (shuttle.process_state)
Expand Down
1 change: 1 addition & 0 deletions code/modules/shuttles/shuttle_emergency.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@
if(SHUTTLE_IDLE) shuttle_state = "idle"
if(SHUTTLE_WARMUP) shuttle_state = "warmup"
if(SHUTTLE_INTRANSIT) shuttle_state = "in_transit"
if(SHUTTLE_HALT) shuttle_state = "halt"

var/shuttle_status
switch (shuttle.process_state)
Expand Down
13 changes: 11 additions & 2 deletions code/modules/shuttles/shuttle_ferry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
var/move_time = 0 //the time spent in the transition area
var/transit_direction = null //needed for area/move_contents_to() to properly handle shuttle corners - not exactly sure how it works.

var/area_station
var/area_offsite
var/area/area_station
var/area/area_offsite
//TODO: change location to a string and use a mapping for area and dock targets.
var/dock_target_station
var/dock_target_offsite
Expand Down Expand Up @@ -67,6 +67,13 @@
Doing so will ensure that multiple jumps cannot be initiated in parallel.
*/
/datum/shuttle/ferry/process()
if(moving_status != SHUTTLE_HALT)
if(!area_station || !area_offsite)
moving_status = SHUTTLE_HALT
return
if(!area_station.contents.len || !area_offsite.contents.len)
moving_status = SHUTTLE_HALT
return
switch(process_state)
if (WAIT_LAUNCH)
if (skip_docking_checks() || docking_controller.can_launch())
Expand Down Expand Up @@ -151,6 +158,8 @@
return 0

/datum/shuttle/ferry/proc/can_cancel()
if(moving_status == SHUTTLE_HALT)
return 0
if (moving_status == SHUTTLE_WARMUP || process_state == WAIT_LAUNCH || process_state == FORCE_LAUNCH)
return 1
return 0
Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/neexplody.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: Karolis2011
delete-after: True
changes:
- bugfix: "Bluespace drives have been improved to prevent critical drive failure."
2 changes: 2 additions & 0 deletions nano/templates/shuttle_control_console.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<span style="font-weight: bold;color: #336699">SPINNING UP</span>
{{else data.shuttle_state == "in_transit"}}
<span style="font-weight: bold;color: #336699">ENGAGED</span>
{{else data.shuttle_state == "halt"}}
<span class="bad">NO DESTINATION</span>
{{else}}
<span class="bad">ERROR</span>
{{/if}}
Expand Down

0 comments on commit 204b161

Please sign in to comment.