Skip to content

Commit

Permalink
Removes current destination for a shuttle in transit from the destina…
Browse files Browse the repository at this point in the history
…tion list (#75170)

## About The Pull Request

Shuttles with multiple destinations will no longer show the current
destination as a selectable choice during transit.

<details>
<summary>Example</summary>
A shuttle has two possible destinations. A and B. <br>
While at A, the only valid destination is B and vice-versa. <br>
But while in transit to B, _both_ A and B can be chosen as destinations.
<br><br>
The change now hides B as a valid destination, as you are already going
there. <br>
It has the nice side effect of making shuttles with only two
destinations never showing a dropdown list while in transit.
</details>

## Why It's Good For The Game

Telling the shuttle to go to the same place as you're going to doesn't
do anything.

## Changelog
:cl:
qol: Shuttles will no longer show their current destination as a choice
while in transit.
/:cl:
  • Loading branch information
Shadow-Quill authored and Absolucy committed May 20, 2024
1 parent dc2dbc5 commit 17543a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/modules/shuttle/computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,15 @@
/obj/machinery/computer/shuttle/proc/get_valid_destinations()
var/list/destination_list = params2list(possible_destinations)
var/obj/docking_port/mobile/mobile_docking_port = SSshuttle.getShuttle(shuttleId)
var/obj/docking_port/stationary/current_destination = mobile_docking_port.destination
var/list/valid_destinations = list()
for(var/obj/docking_port/stationary/stationary_docking_port in SSshuttle.stationary_docking_ports)
if(!destination_list.Find(stationary_docking_port.port_destinations))
continue
if(!mobile_docking_port.check_dock(stationary_docking_port, silent = TRUE))
continue
if(stationary_docking_port == current_destination)
continue
var/list/location_data = list(
id = stationary_docking_port.shuttle_id,
name = stationary_docking_port.name
Expand Down

0 comments on commit 17543a3

Please sign in to comment.