Fix connection validation for Conveyor paths; ensure connections are only allowed between start/end points
This commit is contained in:
@@ -291,8 +291,8 @@ function PathConnector({ pathsGroupRef }: { pathsGroupRef: React.MutableRefObjec
|
|||||||
if (firstPath && secondPath &&
|
if (firstPath && secondPath &&
|
||||||
firstPath.type === 'Conveyor' &&
|
firstPath.type === 'Conveyor' &&
|
||||||
secondPath.type === 'Conveyor' &&
|
secondPath.type === 'Conveyor' &&
|
||||||
!firstSelected?.isCorner) {
|
(!firstSelected?.isCorner || !isStartOrEnd)) {
|
||||||
console.log("Conveyor middle points can only connect to non-conveyor paths");
|
console.log("Conveyor connections must be between start/end points");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,7 +507,10 @@ function PathConnector({ pathsGroupRef }: { pathsGroupRef: React.MutableRefObjec
|
|||||||
!isVehicleConnectingToNonConveyor &&
|
!isVehicleConnectingToNonConveyor &&
|
||||||
firstSelected.sphereUUID !== sphereUUID &&
|
firstSelected.sphereUUID !== sphereUUID &&
|
||||||
firstSelected.pathUUID !== pathUUID &&
|
firstSelected.pathUUID !== pathUUID &&
|
||||||
(firstSelected.isCorner || isConnectable)
|
(firstSelected.isCorner || isConnectable) &&
|
||||||
|
!(firstPath?.type === 'Conveyor' &&
|
||||||
|
pathData.type === 'Conveyor' &&
|
||||||
|
!(firstSelected.isCorner && isConnectable))
|
||||||
) {
|
) {
|
||||||
snappedSphere = {
|
snappedSphere = {
|
||||||
sphereUUID,
|
sphereUUID,
|
||||||
|
|||||||
Reference in New Issue
Block a user