mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
Refactors how circuit size is calculated. Fixed module circuit size not taking up capacity equal to the amount of circuit components inside of it. (#61554)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
f109d9d654
commit
1a507d23ed
@@ -46,6 +46,16 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/module/add_component(obj/item/circuit_component/to_add, mob/living/user)
|
||||
. = ..()
|
||||
if(attached_module)
|
||||
attached_module.circuit_size += to_add.circuit_size
|
||||
|
||||
/obj/item/integrated_circuit/module/remove_component(obj/item/circuit_component/to_remove)
|
||||
if(attached_module)
|
||||
attached_module.circuit_size -= to_remove.circuit_size
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/module/Destroy()
|
||||
attached_module = null
|
||||
return ..()
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
var/datum/circuit_variable/current_variable
|
||||
|
||||
circuit_size = 0
|
||||
|
||||
/obj/item/circuit_component/getter/populate_options()
|
||||
variable_name = add_option_port("Variable", null)
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
var/current_type
|
||||
|
||||
circuit_size = 0
|
||||
|
||||
/obj/item/circuit_component/setter/populate_options()
|
||||
variable_name = add_option_port("Variable", null)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user