From e87bc13ef00b01c966f6f0d0b60854512a4a3f54 Mon Sep 17 00:00:00 2001
From: Sharkmare <34294231+Sharkmare@users.noreply.github.com>
Date: Fri, 19 Feb 2021 13:03:03 +0100
Subject: [PATCH] Adds ability ot changed folded pai access
Allows PAI access to be changed in folded form.
This is literally just a copy paste job with the variable paths changed.
Origin code can be found in pai.dm
---
code/game/objects/items/devices/paicard_ch.dm | 18 ++++++++++++++++++
vorestation.dme | 1 +
2 files changed, 19 insertions(+)
create mode 100644 code/game/objects/items/devices/paicard_ch.dm
diff --git a/code/game/objects/items/devices/paicard_ch.dm b/code/game/objects/items/devices/paicard_ch.dm
new file mode 100644
index 0000000000..b6ce0d69d8
--- /dev/null
+++ b/code/game/objects/items/devices/paicard_ch.dm
@@ -0,0 +1,18 @@
+/obj/item/device/paicard/attackby(obj/item/weapon/W as obj, mob/user as mob)
+ var/obj/item/weapon/card/id/ID = W.GetID()
+ if(ID)
+ if (src.pai.idaccessible == 1)
+ switch(alert(user, "Do you wish to add access to [src] or remove access from [src]?",,"Add Access","Remove Access", "Cancel"))
+ if("Add Access")
+ src.pai.idcard.access |= ID.access
+ to_chat(user, "You add the access from the [W] to [src].")
+ return
+ if("Remove Access")
+ src.pai.idcard.access = list()
+ to_chat(user, "You remove the access from [src].")
+ return
+ if("Cancel")
+ return
+ else if (istype(W, /obj/item/weapon/card/id) && src.pai.idaccessible == 0)
+ to_chat(user, "[src] is not accepting access modifcations at this time.")
+ return
\ No newline at end of file
diff --git a/vorestation.dme b/vorestation.dme
index 6f000d6ae7..71199b0a64 100644
--- a/vorestation.dme
+++ b/vorestation.dme
@@ -1203,6 +1203,7 @@
#include "code\game\objects\items\devices\modkit.dm"
#include "code\game\objects\items\devices\multitool.dm"
#include "code\game\objects\items\devices\paicard.dm"
+#include "code\game\objects\items\devices\paicard_ch.dm"
#include "code\game\objects\items\devices\pipe_painter.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\scanners.dm"