Assembly Line

Assembly Line

65.4k Downloads

[1.7] Rework pipe belt item movement

DarkGuardsman opened this issue ยท 1 comments

commented

A few parts of the item movement logic have no sanity checks. The code simply checks if the slot is empty and then moves the item. The problem with this is most of the VE inventory code has no validation for slots outside of the inventory. This is by design to prevent crashes due to other mods. However, this creates some internal logic problems.

The main issue is when the belt tries to move to an invalid slot. It will ask the inventory if the slot is empty, the inventory will return yes. Then it will set the slot with the item, which also runs without an issue. Followed by deleting the item from the previous slot. Due to the slot being invalid this results in the item being destroyed.

What needs to happen is either some sanity checks (is slot valid) or movement helps (move item slot 1 to slot 2). The second option would include the first option and would be a better choice. As it will simplify the code and create a useful prefab.

commented

Stale issue message