Skip to content

Commit

Permalink
front: fix trains not stopping at the end of path
Browse files Browse the repository at this point in the history
  • Loading branch information
SharglutDev committed Jun 28, 2024
1 parent 435263b commit 6507994
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@ const Pathfinding = ({ pathProperties, setPathProperties }: PathfindingProps) =>
kp: correspondingOp.kp,
coordinates: correspondingOp.coordinates,
positionOnPath: pathfindingResult.path_items_positions[i],
stopFor: i === pathSteps.length - 1 && !step.stopFor ? '0' : step.stopFor,
}
: { ...step, positionOnPath: pathfindingResult.path_items_positions[i] };
: {
...step,
positionOnPath: pathfindingResult.path_items_positions[i],
stopFor: i === pathSteps.length - 1 && !step.stopFor ? '0' : step.stopFor,
};
});
dispatch(updatePathSteps(updatedPathSteps));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ const TypeAndPathV2 = ({ setPathProperties }: PathfindingProps) => {
kp: correspondingOp.kp,
coordinates: correspondingOp.coordinates,
positionOnPath: pathfindingResult.path_items_positions[i],
stopFor: i === opList.length - 1 ? '0' : undefined,
};
});
dispatch(updatePathSteps(pathSteps));
Expand Down

0 comments on commit 6507994

Please sign in to comment.