Belt Balancer 2


Adds Balancer Parts, that can be put together, to balance all adjusting lanes. Updated for better performance and 2.0

Utilities
10 months ago
2.0
16.7K
Logistics

b ERROR: 'durability': real number expected got boolean.

10 months ago

Error while running event belt-balancer-2::on_nth_tick(4)
'durability': real number expected got boolean.
stack traceback:
[C]: in function 'insert_at_back'
belt-balancer-2/objects/balancer.lua:234: in function 'try_insert_and_next'
belt-balancer-2/objects/balancer.lua:244: in function 'run'
belt-balancer-2/helper/message-handler.lua:33: in function <belt-balancer-2/helper/message-handler.lua:31>

10 months ago

Idk how to fix, probably caused by possibility of toolPrototypes to have infinite durability, but I don't meet it, and insert_at_back require to have double at durability field

10 months ago

Probably in conversion we can add check is it tool and if it is, then does this have infinite durability, but what it gives I don't understand, since I don't understand conception of infinite durability and what it does, when it enabled on Tool

10 months ago
(updated 10 months ago)

I realised how I got this crash. I tried to balance armors via balancer parts, since it was kinda my last actions and ArmorPrototype inherits Infinite(bool) from ToolPrototype, also I checked, conversion.lua doesn't do anything, when type is 'armor'

10 months ago

How to reproduce:
Try to sort any armor

How to fix:
In helper/conversion.lua:
durability = (type == "tool" or type == "repair-tool") and stack.durability,
change to
durability = (type == "tool" or type == "repair-tool" or type == 'armor') and stack.durability,

New response