mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +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
@@ -51,6 +51,7 @@
|
||||
if(ispath(circuit_component))
|
||||
circuit_component = new circuit_component()
|
||||
circuit_component.removable = FALSE
|
||||
circuit_component.set_circuit_size(0)
|
||||
RegisterSignal(circuit_component, COMSIG_CIRCUIT_COMPONENT_SAVE, .proc/save_component)
|
||||
unremovable_circuit_components += circuit_component
|
||||
|
||||
@@ -178,7 +179,7 @@
|
||||
source.balloon_alert(attacker, "there is already a circuitboard inside!")
|
||||
return
|
||||
|
||||
if(length(logic_board.attached_components) - length(unremovable_circuit_components) > capacity)
|
||||
if(logic_board.current_size > capacity)
|
||||
source.balloon_alert(attacker, "this is too large to fit into [parent]!")
|
||||
return
|
||||
|
||||
@@ -251,8 +252,8 @@
|
||||
source.balloon_alert(user, "it's locked!")
|
||||
return COMPONENT_CANCEL_ADD_COMPONENT
|
||||
|
||||
if(length(attached_circuit.attached_components) - length(unremovable_circuit_components) >= capacity)
|
||||
source.balloon_alert(user, "it's at maximum capacity!")
|
||||
if(attached_circuit.current_size + added_comp.circuit_size > capacity)
|
||||
source.balloon_alert(user, "it won't fit!")
|
||||
return COMPONENT_CANCEL_ADD_COMPONENT
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user