This commit is contained in:
SandPoot
2022-12-11 17:58:45 -03:00
parent 567cd000e5
commit 8911fe5e0b
41 changed files with 375 additions and 213 deletions
+8 -5
View File
@@ -82,15 +82,15 @@
if(M.buffer && !istype(M.buffer, /obj/machinery/ticket_machine))
return
var/obj/item/assembly/control/ticket_machine/controller = device
controller.linked = M.buffer
controller.linked = WEAKREF(M.buffer)
id = null
controller.id = null
to_chat(user, "<span class='warning'>You've linked [src] to [controller.linked].</span>")
to_chat(user, "<span class='warning'>You've linked [src] to [M.buffer].</span>")
/obj/item/assembly/control/ticket_machine
name = "ticket machine controller"
desc = "A remote controller for the HoP's ticket machine."
var/obj/machinery/ticket_machine/linked //To whom are we linked?
var/datum/weakref/linked //To whom are we linked?
/obj/item/assembly/control/ticket_machine/Initialize(mapload)
..()
@@ -102,7 +102,7 @@
/obj/item/assembly/control/ticket_machine/proc/find_machine() //Locate the one to which we're linked
for(var/obj/machinery/ticket_machine/ticketsplease in GLOB.machines)
if(ticketsplease.id == id)
linked = ticketsplease
linked = WEAKREF(ticketsplease)
if(linked)
return TRUE
else
@@ -113,8 +113,11 @@
return
if(!linked)
return
var/obj/machinery/ticket_machine/machine = linked.resolve()
if(!machine)
return
cooldown = TRUE
linked.increment()
machine.increment()
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10)
/obj/machinery/ticket_machine/update_icon()