mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 03:59:59 +01:00
## About The Pull Request I discovered that wire bundle components weren't populating their ports properly while working on another PR. This fixes that. ## Why It's Good For The Game It would be nice if a circuit component worked, you know, at all. ## Changelog 🆑 fix: wire bundle circuit components work once again /🆑
25 lines
859 B
Plaintext
25 lines
859 B
Plaintext
#define CAPACITY_PER_WIRE 10
|
|
|
|
/datum/wires/wire_bundle_component
|
|
holder_type = /atom //Anything that can have a shell component, really.
|
|
randomize = TRUE
|
|
wire_behavior = WIRES_ALL
|
|
|
|
/datum/wires/wire_bundle_component/New(atom/holder)
|
|
var/datum/component/shell/shell_comp = holder.GetComponent(/datum/component/shell)
|
|
if(!istype(shell_comp))
|
|
CRASH("Holder does not have a shell component!")
|
|
var/wire_count = clamp(round(shell_comp.capacity / CAPACITY_PER_WIRE, 1), 1, MAX_WIRE_COUNT)
|
|
for(var/index in 1 to wire_count)
|
|
LAZYADD(wires, "Port [index]")
|
|
..()
|
|
|
|
/datum/wires/wire_bundle_component/always_reveal_wire(color)
|
|
return TRUE // Let's not make wiring up this stuff confusing - just give them what wires correspond to what ports.
|
|
|
|
/datum/wires/wire_bundle_component/ui_data(mob/user)
|
|
proper_name = holder.name
|
|
. = ..()
|
|
|
|
#undef CAPACITY_PER_WIRE
|