[MIRROR] Fixes the supply console not inheriting contraband and emag status from its circuit (#1197)

* Fixes the supply console not inheriting contraband and emag status from its circuit (#54177)

Added an abstract proc for circuits intended to be used to allow a circuit to configure a machine.

Overrode this proc for supply console boards (behaviour inherited by express boards)

Call this proc in supply console on_construction (behaviour inherited by express supply consoles)

Allows all supply consoles to inherit their circuit's emag and contraband status.

Doesn't look like any other circuits use this sort of functionality, but if they do I'll fix 'em up too.

* Fixes the supply console not inheriting contraband and emag status from its circuit

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
SkyratBot
2020-10-07 23:26:39 +02:00
committed by GitHub
co-authored by Timberpoes
parent 453bcc995c
commit 65a2223ddf
3 changed files with 23 additions and 6 deletions
@@ -40,6 +40,15 @@
return
/**
* Used to allow the circuitboard to configure a machine in some way, shape or form.
*
* Arguments:
* * machine - The machine to attempt to configure.
*/
/obj/item/circuitboard/proc/configure_machine(obj/machinery/machine)
return
// Circuitboard/machine
/*Common Parts: Parts List: Ignitor, Timer, Infra-red laser, Infra-red sensor, t_scanner, Capacitor, Valve, sensor unit,
micro-manipulator, console screen, beaker, Microlaser, matter bin, power cells.
@@ -500,6 +500,16 @@
obj_flags |= EMAGGED
to_chat(user, "<span class='notice'>You adjust [src]'s routing and receiver spectrum, unlocking special supplies and contraband.</span>")
/obj/item/circuitboard/computer/cargo/configure_machine(obj/machinery/computer/cargo/machine)
if(!istype(machine))
CRASH("Cargo board attempted to configure incorrect machine type: [machine] ([machine?.type])")
machine.contraband = contraband
if (obj_flags & EMAGGED)
machine.obj_flags |= EMAGGED
else
machine.obj_flags &= ~EMAGGED
/obj/item/circuitboard/computer/cargo/express
name = "Express Supply Console (Computer Board)"
build_path = /obj/machinery/computer/cargo/express