From aa174ad39eb0d763e9c7fa64de762740de3fe594 Mon Sep 17 00:00:00 2001
From: TDSSS <32099540+TDSSS@users.noreply.github.com>
Date: Thu, 13 Aug 2020 13:07:23 +0200
Subject: [PATCH] incorporates more review comments
---
code/modules/shuttle/ert.dm | 8 ++++----
code/modules/shuttle/shuttle.dm | 8 +++++++-
code/modules/shuttle/syndicate.dm | 10 +++++-----
tgui/packages/tgui/interfaces/ShuttleConsole.js | 2 +-
tgui/packages/tgui/public/tgui.bundle.js | 2 +-
5 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/code/modules/shuttle/ert.dm b/code/modules/shuttle/ert.dm
index 2bf27699d9d..ddb7bb343b6 100644
--- a/code/modules/shuttle/ert.dm
+++ b/code/modules/shuttle/ert.dm
@@ -6,12 +6,12 @@
resistance_flags = INDESTRUCTIBLE
flags = NODECONSTRUCT
-/obj/machinery/computer/shuttle/ert/tgui_act(action, params)
+/obj/machinery/computer/shuttle/ert/can_call_shuttle(mob/user, action)
if(action == "move")
var/authorized_roles = list(SPECIAL_ROLE_ERT, SPECIAL_ROLE_DEATHSQUAD)
- if(!((usr.mind?.assigned_role in authorized_roles) || is_admin(usr)))
- message_admins("Potential ERT shuttle hijack, ERT shuttle moved by unauthorized user: [key_name_admin(usr)]")
- ..()
+ if(!((user.mind?.assigned_role in authorized_roles) || is_admin(user)))
+ message_admins("Potential ERT shuttle hijack, ERT shuttle moved by unauthorized user: [key_name_admin(user)]")
+ return TRUE
/obj/machinery/computer/camera_advanced/shuttle_docker/ert
name = "specops navigation computer"
diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm
index dc56e27be64..73544e02b86 100644
--- a/code/modules/shuttle/shuttle.dm
+++ b/code/modules/shuttle/shuttle.dm
@@ -805,7 +805,9 @@
return TRUE
if(!allowed(usr))
to_chat(usr, "Access denied.")
- return FALSE
+ return TRUE
+ if(!can_call_shuttle(usr, action))
+ return TRUE
var/list/options = params2list(possible_destinations)
if(action == "move")
var/destination = params["move"]
@@ -831,6 +833,10 @@
emagged = 1
to_chat(user, "You fried the consoles ID checking system.")
+//for restricting when the computer can be used, needed for some console subtypes.
+/obj/machinery/computer/shuttle/proc/can_call_shuttle(mob/user, action)
+ return TRUE
+
/obj/machinery/computer/shuttle/ferry
name = "transport ferry console"
circuit = /obj/item/circuitboard/ferry
diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm
index ddad4180b44..1ff2959ff08 100644
--- a/code/modules/shuttle/syndicate.dm
+++ b/code/modules/shuttle/syndicate.dm
@@ -17,12 +17,12 @@
circuit = /obj/item/circuitboard/shuttle/syndicate/recall
possible_destinations = "syndicate_away"
-/obj/machinery/computer/shuttle/syndicate/tgui_act(action, params)
+/obj/machinery/computer/shuttle/syndicate/can_call_shuttle(user, action)
if(action == "move")
if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER)
- to_chat(usr, "You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare.")
+ to_chat(user, "You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare.")
return FALSE
- ..()
+ return TRUE
/obj/machinery/computer/shuttle/syndicate/drop_pod
name = "syndicate assault pod control"
@@ -33,10 +33,10 @@
shuttleId = "steel_rain"
possible_destinations = null
-/obj/machinery/computer/shuttle/syndicate/drop_pod/tgui_act(action, params)
+/obj/machinery/computer/shuttle/syndicate/drop_pod/can_call_shuttle(user, action)
if(action == "move")
if(z != level_name_to_num(CENTCOMM))
- to_chat(usr, "Pods are one way!")
+ to_chat(user, "Pods are one way!")
return FALSE
..()
diff --git a/tgui/packages/tgui/interfaces/ShuttleConsole.js b/tgui/packages/tgui/interfaces/ShuttleConsole.js
index bc4607afa56..1ad9582ac20 100644
--- a/tgui/packages/tgui/interfaces/ShuttleConsole.js
+++ b/tgui/packages/tgui/interfaces/ShuttleConsole.js
@@ -38,7 +38,7 @@ export const ShuttleConsole = (props, context) => {
Shuttle Locked
{!!data.admin_controlled && (
-
+