Prevents shuttle from moving if there is no destination. (#7991)

This commit is contained in:
Karolis
2020-01-12 11:36:47 +01:00
committed by Matt Atlas
parent 2d0ba5137d
commit 204b1614e3
8 changed files with 24 additions and 2 deletions
@@ -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)
+3
View File
@@ -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()
+1
View File
@@ -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)
@@ -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)
+11 -2
View File
@@ -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
@@ -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())
@@ -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