[MIRROR] Makes obj_integrity private and only updated through procs (#6125)

* Makes obj_integrity only updated through procs (#59474)

Having things updating integrity directly is just going to cause more problems down the line as more elements and components depend on being notified of integrity changes. It's an easy mistake to make so making it private should deal with the problem.

get_integrity() might be useful in the future but is mainly a side effect of making obj_integrity private as that also disallows reads.

* Makes obj_integrity private and only updated through procs

* Mirror!

Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
Co-authored-by: Funce <funce.973@gmail.com>
This commit is contained in:
SkyratBot
2021-06-05 06:35:09 +02:00
committed by GitHub
parent dc57646706
commit fbb78302cf
54 changed files with 141 additions and 106 deletions
@@ -33,7 +33,7 @@
hardware_flag = machinery_computer.hardware_flag
max_hardware_size = machinery_computer.max_hardware_size
steel_sheet_cost = machinery_computer.steel_sheet_cost
obj_integrity = machinery_computer.obj_integrity
update_integrity(machinery_computer.get_integrity())
max_integrity = machinery_computer.max_integrity
integrity_failure = machinery_computer.integrity_failure
base_active_power_usage = machinery_computer.base_active_power_usage
@@ -82,7 +82,7 @@
else
. += cpu.active_program?.program_icon_state || screen_icon_state_menu
if(cpu && cpu.obj_integrity <= cpu.integrity_failure * cpu.max_integrity)
if(cpu && cpu.get_integrity() <= cpu.integrity_failure * cpu.max_integrity)
. += "bsod"
. += "broken"