1
0
mirror of https://github.com/teoxoy/factorio-blueprint-editor.git synced 2025-03-27 21:39:03 +02:00

fix duplicate wires on same entity

Bug that was fixed: connecting the input to the output of a decider/arithmetic combinator produced a different wire than connecting the output to the input.
This commit is contained in:
cryhot 2023-10-28 11:20:50 -05:00 committed by Teodor Tanasoaia
parent fd197792d8
commit 83343e6a6c

View File

@ -27,7 +27,7 @@ export class WireConnections extends EventEmitter {
}
private static hash(conn: IConnection): string {
const cps = conn.cps.sort((cp1,cp2) => cp1.entityNumber - cp2.entityNumber)
const cps = conn.cps.sort((cp1,cp2) => cp1.entityNumber-cp2.entityNumber || cp1.entitySide-cp2.entitySide)
const [firstE, secondE] = cps.map(cp => cp.entityNumber)
const [firstS, secondS] = cps.map(cp => cp.entitySide)
return `${conn.color}-${firstE}-${secondE}-${firstS}-${secondS}`