[MIRROR] Fixes navigation computers giving too many port jumping actions [MDB IGNORE] (#10761)

* Fixes navigation computers giving too many port jumping actions (#64054)

* Fixes navigation computers giving too many port jumping actions

I'm adding a vestigial proc here, remove_jumpable_port
I prefer this over not fully implementing the behavior, hopefully it'll be of use to someone

* Fixes navigation computers giving too many port jumping actions

* Fixes navigation computers giving too many port jumping actions

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-01-19 22:12:58 +01:00
committed by GitHub
parent 02698a4075
commit 4ef2012a58
8 changed files with 55 additions and 36 deletions

View File

@@ -44,7 +44,7 @@
lock_override = CAMERA_LOCK_STATION
shuttlePortId = "huntership_custom"
see_hidden = FALSE
jumpto_ports = list("huntership_home" = 1, "whiteship_home" = 1, "syndicate_nw" = 1)
jump_to_ports = list("huntership_home" = 1, "whiteship_home" = 1, "syndicate_nw" = 1)
view_range = 4.5
/obj/structure/closet/crate/eva

View File

@@ -68,7 +68,7 @@
shuttleId = "caravantrade1"
lock_override = NONE
shuttlePortId = "caravantrade1_custom"
jumpto_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "caravantrade1_ambush" = 1)
jump_to_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "caravantrade1_ambush" = 1)
view_range = 6.5
x_offset = -5
y_offset = -5
@@ -92,7 +92,7 @@
shuttleId = "caravanpirate"
lock_override = NONE
shuttlePortId = "caravanpirate_custom"
jumpto_ports = list("caravanpirate_ambush" = 1)
jump_to_ports = list("caravanpirate_ambush" = 1)
view_range = 6.5
x_offset = 3
y_offset = -6
@@ -116,7 +116,7 @@
shuttleId = "caravansyndicate1"
lock_override = NONE
shuttlePortId = "caravansyndicate1_custom"
jumpto_ports = list("caravansyndicate1_ambush" = 1, "caravansyndicate1_listeningpost" = 1)
jump_to_ports = list("caravansyndicate1_ambush" = 1, "caravansyndicate1_listeningpost" = 1)
view_range = 0
x_offset = 2
y_offset = 0
@@ -140,7 +140,7 @@
shuttleId = "caravansyndicate2"
lock_override = NONE
shuttlePortId = "caravansyndicate2_custom"
jumpto_ports = list("caravansyndicate2_ambush" = 1, "caravansyndicate1_listeningpost" = 1)
jump_to_ports = list("caravansyndicate2_ambush" = 1, "caravansyndicate1_listeningpost" = 1)
view_range = 0
x_offset = 0
y_offset = 2
@@ -164,7 +164,7 @@
shuttleId = "caravansyndicate3"
lock_override = NONE
shuttlePortId = "caravansyndicate3_custom"
jumpto_ports = list("caravansyndicate3_ambush" = 1, "caravansyndicate3_listeningpost" = 1)
jump_to_ports = list("caravansyndicate3_ambush" = 1, "caravansyndicate3_listeningpost" = 1)
view_range = 2.5
x_offset = -1
y_offset = -3

View File

@@ -84,19 +84,19 @@
/obj/machinery/computer/camera_advanced/shuttle_docker/syndicate/fighter/fighter_one
shuttleId = "SBC_fighter1"
shuttlePortId = "SBC_fighter1_custom"
jumpto_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter1_bay" = 1)
jump_to_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter1_bay" = 1)
req_access = list(ACCESS_SYNDICATE)
/obj/machinery/computer/camera_advanced/shuttle_docker/syndicate/fighter/fighter_two
shuttleId = "SBC_fighter2"
shuttlePortId = "SBC_fighter2_custom"
jumpto_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter2_bay" = 1)
jump_to_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter2_bay" = 1)
req_access = list(ACCESS_SYNDICATE)
/obj/machinery/computer/camera_advanced/shuttle_docker/syndicate/fighter/fighter_three
shuttleId = "SBC_fighter3"
shuttlePortId = "SBC_fighter3_custom"
jumpto_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter3_bay" = 1)
jump_to_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_fighter3_bay" = 1)
req_access = list(ACCESS_SYNDICATE)
/obj/machinery/computer/camera_advanced/shuttle_docker/syndicate/corvette
@@ -104,7 +104,7 @@
desc = "Used to pilot the syndicate corvette to board enemy stations and ships."
shuttleId = "SBC_corvette"
shuttlePortId = "SBC_corvette_custom"
jumpto_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_corvette_bay" = 1)
jump_to_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1, "SBC_corvette_bay" = 1)
y_offset = 3
x_offset = 0

View File

@@ -11,10 +11,14 @@
var/shuttleId = ""
var/shuttlePortId = ""
var/shuttlePortName = "custom location"
var/list/jumpto_ports = list() //hashset of ports to jump to and ignore for collision purposes
var/obj/docking_port/stationary/my_port //the custom docking port placed by this console
var/obj/docking_port/mobile/shuttle_port //the mobile docking port of the connected shuttle
var/list/locked_traits = list(ZTRAIT_RESERVED, ZTRAIT_CENTCOM, ZTRAIT_AWAY) //traits forbided for custom docking
/// Hashset of ports to jump to and ignore for collision purposes
var/list/jump_to_ports = list()
/// The custom docking port placed by this console
var/obj/docking_port/stationary/my_port
/// The mobile docking port of the connected shuttle
var/obj/docking_port/mobile/shuttle_port
// Traits forbided for custom docking
var/list/locked_traits = list(ZTRAIT_RESERVED, ZTRAIT_CENTCOM, ZTRAIT_AWAY)
var/view_range = 0
var/x_offset = 0
var/y_offset = 0
@@ -30,19 +34,20 @@
actions += new /datum/action/innate/shuttledocker_rotate(src)
actions += new /datum/action/innate/shuttledocker_place(src)
set_init_ports()
if(!mapload)
connect_to_shuttle(SSshuttle.get_containing_shuttle(src))
for(var/obj/docking_port/stationary/S as anything in SSshuttle.stationary_docking_ports)
if(S.id == shuttleId)
jumpto_ports[S.id] = TRUE
for(var/obj/docking_port/stationary/port as anything in SSshuttle.stationary_docking_ports)
if(port.id == shuttleId)
add_jumpable_port(port.id)
for(var/V in SSshuttle.stationary_docking_ports)
if(!V)
for(var/obj/docking_port/stationary/port as anything in SSshuttle.stationary_docking_ports)
if(!port)
continue
var/obj/docking_port/stationary/S = V
if(jumpto_ports[S.id])
z_lock |= S.z
if(jump_to_ports[port.id])
z_lock |= port.z
whitelist_turfs = typecacheof(whitelist_turfs)
/obj/machinery/computer/camera_advanced/shuttle_docker/Destroy()
@@ -57,6 +62,25 @@
else
QDEL_NULL(my_port)
/// "Initializes" any default port ids we have, done so add_jumpable_port can be a proper setter
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/set_init_ports()
var/list/init_ports = jump_to_ports.Copy()
jump_to_ports = list() //Reset it so we don't get dupes
for(var/port_id in init_ports)
add_jumpable_port(port_id)
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/add_jumpable_port(port_id)
if(!length(jump_to_ports))
actions += new /datum/action/innate/camera_jump/shuttle_docker(src)
jump_to_ports[port_id] = TRUE
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/remove_jumpable_port(port_id)
jump_to_ports -= port_id
if(!length(jump_to_ports))
var/datum/action/to_remove = locate(/datum/action/innate/camera_jump/shuttle_docker) in actions
actions -= to_remove
qdel(to_remove)
/obj/machinery/computer/camera_advanced/shuttle_docker/attack_hand(mob/user, list/modifiers)
if(jammed)
to_chat(user, span_warning("The Syndicate is jamming the console!"))
@@ -66,11 +90,6 @@
return
return ..()
/obj/machinery/computer/camera_advanced/shuttle_docker/GrantActions(mob/living/user)
if(jumpto_ports.len)
actions += new /datum/action/innate/camera_jump/shuttle_docker(src)
..()
/obj/machinery/computer/camera_advanced/shuttle_docker/CreateEye()
shuttle_port = SSshuttle.getShuttle(shuttleId)
if(QDELETED(shuttle_port))
@@ -282,7 +301,7 @@
shuttleId = port.id
shuttlePortId = "[port.id]_custom"
if(dock)
jumpto_ports[dock.id] = TRUE
add_jumpable_port(dock.id)
/mob/camera/ai_eye/remote/shuttle_docker
visible_icon = FALSE
@@ -349,7 +368,7 @@
var/obj/docking_port/stationary/S = V
if(console.z_lock.len && !(S.z in console.z_lock))
continue
if(console.jumpto_ports[S.id])
if(console.jump_to_ports[S.id])
L["([L.len])[S.name]"] = S
for(var/V in SSshuttle.beacon_list)

View File

@@ -62,7 +62,7 @@
shuttleId = "syndicate"
lock_override = CAMERA_LOCK_STATION
shuttlePortId = "syndicate_custom"
jumpto_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1)
jump_to_ports = list("syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1)
view_range = 5.5
x_offset = -7
y_offset = -1

View File

@@ -34,7 +34,7 @@
shuttleId = "whiteship"
lock_override = NONE
shuttlePortId = "whiteship_custom"
jumpto_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1)
jump_to_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1)
view_range = 10
x_offset = -6
y_offset = -10
@@ -45,7 +45,7 @@
desc = "Used to designate a precise transit location for the Salvage Pod."
shuttleId = "whiteship_pod"
shuttlePortId = "whiteship_pod_custom"
jumpto_ports = list("whiteship_pod_home" = 1)
jump_to_ports = list("whiteship_pod_home" = 1)
view_range = 0
x_offset = -2
y_offset = 0

View File

@@ -18,7 +18,7 @@
see_hidden = FALSE
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
jumpto_ports = list("tradership" = 1, "tradership_away" = 1, "tradership_custom" = 1,"whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "caravantrade1_ambush" = 1, "whiteship_lavaland" = 1)
jump_to_ports = list("tradership" = 1, "tradership_away" = 1, "tradership_custom" = 1,"whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "caravantrade1_ambush" = 1, "whiteship_lavaland" = 1)
whitelist_turfs = list(/turf/open/space, /turf/open/floor/plating, /turf/open/lava, /turf/closed/mineral)
lock_override = NONE

View File

@@ -29,7 +29,7 @@
shuttleId = "blackmarket_chevvy"
lock_override = NONE
shuttlePortId = "blackmarket_chevvy_custom"
jumpto_ports = list("blackmarket_chevvy_home" = 1, "whiteship_home" = 1)
jump_to_ports = list("blackmarket_chevvy_home" = 1, "whiteship_home" = 1)
view_range = 0
x_offset = 2
y_offset = 0
@@ -52,7 +52,7 @@
shuttleId = "slaver_syndie"
lock_override = NONE
shuttlePortId = "slaver"
jumpto_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1)
jump_to_ports = list("whiteship_away" = 1, "whiteship_home" = 1, "whiteship_z4" = 1, "syndicate_ne" = 1, "syndicate_nw" = 1, "syndicate_n" = 1, "syndicate_se" = 1, "syndicate_sw" = 1, "syndicate_s" = 1)
view_range = 10
x_offset = 0
y_offset = 0
@@ -181,7 +181,7 @@
shuttleId = "tarkon_driver"
lock_override = NONE
shuttlePortId = "tarkon_driver_custom"
jumpto_ports = list("port_tarkon" = 1, "whiteship_home" = 1)
jump_to_ports = list("port_tarkon" = 1, "whiteship_home" = 1)
view_range = 0
/obj/item/circuitboard/computer/tarkon_driver