mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Fix belt planner
This commit is contained in:
@@ -393,9 +393,9 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
||||
const pathFromCorner = mouseTile.sub(this.currentDirectionLockCorner);
|
||||
const deltaFromCorner = pathFromCorner.normalize().round();
|
||||
const lengthFromCorner = Math_round(pathFromCorner.length());
|
||||
rotation = (Math.round(Math_degrees(deltaFromCorner.angle()) / 90) * 90 + 360) % 360;
|
||||
|
||||
if (lengthFromCorner > 0) {
|
||||
rotation = (Math.round(Math_degrees(deltaFromCorner.angle()) / 90) * 90 + 360) % 360;
|
||||
for (let i = 0; i < lengthFromCorner + 1; ++i) {
|
||||
result.push({
|
||||
tile: currentPos.copy(),
|
||||
@@ -403,6 +403,12 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart {
|
||||
});
|
||||
currentPos.addInplace(deltaFromCorner);
|
||||
}
|
||||
} else {
|
||||
// Finish last one
|
||||
result.push({
|
||||
tile: currentPos.copy(),
|
||||
rotation,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user