Skip to content

Commit

Permalink
auto-revoke ticket fix
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Sep 4, 2023
1 parent eb8f181 commit 0edf9a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,10 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
var/operator = key_name(user)
var/datum/ares_link/link = GLOB.ares_link
if(logged_in == MAIN_AI_SYSTEM)
operator = "[user.ckey]/([MAIN_AI_SYSTEM])"
if(!user)
operator = "[MAIN_AI_SYSTEM] (Sensor Trip)"
else
operator = "[user.ckey]/([MAIN_AI_SYSTEM])"
if(ACCESS_MARINE_AI_TEMP in access)
access -= ACCESS_MARINE_AI_TEMP
link.active_ids -= src
Expand Down
13 changes: 12 additions & 1 deletion code/game/machinery/ARES/ARES_step_triggers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,18 @@
to_chat(passer, SPAN_BOLDWARNING("You hear a harsh buzzing sound as you cross the threshold!"))
ares_apollo_talk(broadcast_message)
if(idcard)
idcard.access -= ACCESS_MARINE_AI_TEMP
/// Removes the access from the ID and updates the ID's modification log.
for(var/obj/item/card/id/identification in link.active_ids)
if(identification != idcard)
continue
idcard.access -= ACCESS_MARINE_AI_TEMP
link.active_ids -= idcard
idcard.modification_log += "Temporary AI access revoked by [MAIN_AI_SYSTEM]"
/// Updates the related access ticket.
for(var/datum/ares_ticket/access/access_ticket in link.tickets_access)
if(access_ticket.user_id_num != idcard.registered_gid)
continue
access_ticket.ticket_status = TICKET_REVOKED
COOLDOWN_START(src, sensor_cooldown, COOLDOWN_ARES_ACCESS_CONTROL)
if(alert_id && link)
for(var/obj/effect/step_trigger/ares_alert/sensor in link.linked_alerts)
Expand Down

0 comments on commit 0edf9a8

Please sign in to comment.