From d96fd4cd8339d1c68e412bf795fab3929c830535 Mon Sep 17 00:00:00 2001
From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com>
Date: Fri, 17 Jan 2020 10:50:00 +0000
Subject: [PATCH] Protolathe and Circuit Printer check for adjacency when
adding sheets. (#8032)
---
code/modules/research/circuitprinter.dm | 3 +++
code/modules/research/protolathe.dm | 3 +++
html/changelogs/adding_sheets_adjacency_check.yml | 6 ++++++
3 files changed, 12 insertions(+)
create mode 100644 html/changelogs/adding_sheets_adjacency_check.yml
diff --git a/code/modules/research/circuitprinter.dm b/code/modules/research/circuitprinter.dm
index 371c3ba5efa..54c3f188292 100644
--- a/code/modules/research/circuitprinter.dm
+++ b/code/modules/research/circuitprinter.dm
@@ -138,6 +138,9 @@ using metal and glass, it uses glass and reagents (usually sulphuric acid).
var/amount = round(input("How many sheets do you want to add?") as num)
if(!O)
return
+ if(!Adjacent(user))
+ to_chat(user, "\The [src] is too far away for you to insert this.")
+ return
if(amount <= 0)//No negative numbers
return
if(amount > stack.get_amount())
diff --git a/code/modules/research/protolathe.dm b/code/modules/research/protolathe.dm
index 1c50324bec2..901a01a848d 100644
--- a/code/modules/research/protolathe.dm
+++ b/code/modules/research/protolathe.dm
@@ -132,6 +132,9 @@
var/amount = round(input("How many sheets do you want to add?") as num)//No decimals
if(!O)
return
+ if(!Adjacent(user))
+ to_chat(user, "\The [src] is too far away for you to insert this.")
+ return
if(amount <= 0)//No negative numbers
return
if(amount > stack.get_amount())
diff --git a/html/changelogs/adding_sheets_adjacency_check.yml b/html/changelogs/adding_sheets_adjacency_check.yml
new file mode 100644
index 00000000000..92d4425743b
--- /dev/null
+++ b/html/changelogs/adding_sheets_adjacency_check.yml
@@ -0,0 +1,6 @@
+author: mikomyazaki
+
+delete-after: True
+
+changes:
+ - bugfix: "Protolathe and Circuit Printer now properly check for adjacency when being filled with sheets."