From 82e9bc104288f678b11f3b3b57e6bde41b1ab37d Mon Sep 17 00:00:00 2001 From: Geeves Date: Wed, 11 Oct 2023 23:14:33 +0200 Subject: [PATCH] Mech Access Fix (#17549) --- code/controllers/subsystems/virtual_reality.dm | 4 ---- code/game/objects/items/weapons/cards_ids.dm | 13 +++++++++++++ code/modules/heavy_vehicle/mech_interaction.dm | 9 --------- code/modules/heavy_vehicle/mecha.dm | 4 +--- html/changelogs/geeves-mech_access_fix.yml | 6 ++++++ 5 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 html/changelogs/geeves-mech_access_fix.yml diff --git a/code/controllers/subsystems/virtual_reality.dm b/code/controllers/subsystems/virtual_reality.dm index dd417996a37..d645f779dc1 100644 --- a/code/controllers/subsystems/virtual_reality.dm +++ b/code/controllers/subsystems/virtual_reality.dm @@ -89,9 +89,6 @@ SUBSYSTEM_DEF(virtualreality) ckey_transfer(old_mob) languages = list(all_languages[LANGUAGE_TCB]) internal_id.access = list() - if(ismech(loc)) - var/mob/living/heavy_vehicle/HV = loc - HV.access_card.access = list() to_chat(old_mob, SPAN_NOTICE("System exited safely, we hope you enjoyed your stay.")) old_mob = null else @@ -201,7 +198,6 @@ SUBSYSTEM_DEF(virtualreality) var/mob/living/heavy_vehicle/chosen_mech = mech[choice] var/mob/living/remote_pilot = chosen_mech.pilots[1] // the first pilot mind_transfer(user, remote_pilot) - chosen_mech.sync_access() /datum/controller/subsystem/virtualreality/proc/robot_selection(var/user, var/network) var/list/robot = list() diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index a22ec413508..c6b12c09114 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -637,4 +637,17 @@ var/const/NO_EMAG_ACT = -50 /obj/item/card/id/away_site access = list(access_generic_away_site, access_external_airlocks) +/obj/item/card/id/mecha + name = "exosuit access card" + +/obj/item/card/id/mecha/GetAccess() + var/mob/living/heavy_vehicle/exosuit = loc + if(!istype(loc) || !length(exosuit.pilots)) + return list() + var/list/pilot_access = list() + for(var/mob/pilot as anything in exosuit.pilots) + var/obj/item/ID = pilot.GetIdCard() + pilot_access |= ID.GetAccess() + return pilot_access + #undef ID_CARD_UNSET diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm index 6b185e1b2b6..cf54f13ed13 100644 --- a/code/modules/heavy_vehicle/mech_interaction.dm +++ b/code/modules/heavy_vehicle/mech_interaction.dm @@ -240,7 +240,6 @@ user.forceMove(src) LAZYDISTINCTADD(pilots, user) RegisterSignal(user, COMSIG_MOB_FACEDIR, PROC_REF(handle_user_turn)) - sync_access() playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(user.client) user.client.screen |= hud_elements LAZYDISTINCTADD(user.additional_vision_handlers, src) @@ -248,14 +247,6 @@ walk(src, 0) // stop it from auto moving when the pilot gets in return 1 -/mob/living/heavy_vehicle/proc/sync_access() - access_card.access = saved_access.Copy() - if(sync_access) - for(var/mob/pilot in pilots) - var/obj/item/card/id/pilot_id = pilot.GetIdCard() - if(pilot_id && pilot_id.access) access_card.access |= pilot_id.access - to_chat(pilot, "Security access permissions synchronized.") - /mob/living/heavy_vehicle/proc/eject(var/mob/user, var/silent) if(!user || !(user in src.contents)) return diff --git a/code/modules/heavy_vehicle/mecha.dm b/code/modules/heavy_vehicle/mecha.dm index 1cc56b8c740..299fbe00578 100644 --- a/code/modules/heavy_vehicle/mecha.dm +++ b/code/modules/heavy_vehicle/mecha.dm @@ -25,9 +25,7 @@ var/wreckage_path = /obj/structure/mech_wreckage // Access updating/container. - var/obj/item/card/id/access_card - var/list/saved_access = list() - var/sync_access = TRUE + var/obj/item/card/id/mecha/access_card // Mob we're currently paired with or following | the names are saved to prevent metagaming when returning diagnostics var/datum/weakref/leader diff --git a/html/changelogs/geeves-mech_access_fix.yml b/html/changelogs/geeves-mech_access_fix.yml new file mode 100644 index 00000000000..208108d1306 --- /dev/null +++ b/html/changelogs/geeves-mech_access_fix.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - bugfix: "Fixed exosuits not getting access from guest pass cards."