Belt Balancer 2


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

Utilities
4 months ago
2.0
10.0K
Logistics

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

4 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>

4 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

4 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

4 months ago
(updated 4 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'

4 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