From 3ad502c5a7d20c3ab807aa0ca213e1d18b1edfa3 Mon Sep 17 00:00:00 2001 From: tobspr Date: Tue, 1 Feb 2022 17:04:43 +0100 Subject: [PATCH] Fix belt path optimization --- src/js/game/belt_path.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/game/belt_path.js b/src/js/game/belt_path.js index 7e2bfaf4..e1b466e9 100644 --- a/src/js/game/belt_path.js +++ b/src/js/game/belt_path.js @@ -1476,7 +1476,11 @@ export class BeltPath extends BasicSerializableObject { if (drawStack.length > 1) { // Check if we can append to the stack, since its already a stack of two same items const referenceItem = drawStack[0]; - if (Math.abs(referenceItem[0][drawStackProp] - worldPos[drawStackProp]) < 0.001) { + + if ( + referenceItem[1].equals(item) && + Math.abs(referenceItem[0][drawStackProp] - worldPos[drawStackProp]) < 0.001 + ) { // Will continue stack } else { // Start a new stack, since item doesn't follow in row