mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Merge pull request #7134 from AnturK/assemblies
Makes assembly parts work with wires
This commit is contained in:
@@ -132,11 +132,13 @@ var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown",
|
||||
|
||||
// Attach
|
||||
else
|
||||
if(istype(I, /obj/item/device/assembly/signaler))
|
||||
L.drop_item()
|
||||
Attach(colour, I)
|
||||
else
|
||||
L << "<span class='error'>You need a remote signaller!</span>"
|
||||
if(istype(I, /obj/item/device/assembly))
|
||||
var/obj/item/device/assembly/A = I;
|
||||
if(A.attachable)
|
||||
L.drop_item()
|
||||
Attach(colour, A)
|
||||
else
|
||||
L << "<span class='error'>You need a attachable assembly!</span>"
|
||||
|
||||
|
||||
|
||||
@@ -229,8 +231,8 @@ var/const/POWER = 8
|
||||
return signallers[colour]
|
||||
return null
|
||||
|
||||
/datum/wires/proc/Attach(var/colour, var/obj/item/device/assembly/signaler/S)
|
||||
if(colour && S)
|
||||
/datum/wires/proc/Attach(var/colour, var/obj/item/device/assembly/S)
|
||||
if(colour && S && S.attachable)
|
||||
if(!IsAttached(colour))
|
||||
signallers[colour] = S
|
||||
S.loc = holder
|
||||
@@ -239,7 +241,7 @@ var/const/POWER = 8
|
||||
|
||||
/datum/wires/proc/Detach(var/colour)
|
||||
if(colour)
|
||||
var/obj/item/device/assembly/signaler/S = GetAttached(colour)
|
||||
var/obj/item/device/assembly/S = GetAttached(colour)
|
||||
if(S)
|
||||
signallers -= colour
|
||||
S.connected = null
|
||||
@@ -247,7 +249,7 @@ var/const/POWER = 8
|
||||
return S
|
||||
|
||||
|
||||
/datum/wires/proc/Pulse(var/obj/item/device/assembly/signaler/S)
|
||||
/datum/wires/proc/Pulse(var/obj/item/device/assembly/S)
|
||||
|
||||
for(var/colour in signallers)
|
||||
if(S == signallers[colour])
|
||||
|
||||
Reference in New Issue
Block a user