mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Fix belt planner
This commit is contained in:
parent
2c0f0f2152
commit
a6ed85e9da
@ -480,6 +480,21 @@
|
||||
<key>scale9FromFile</key>
|
||||
<false/>
|
||||
</struct>
|
||||
<key type="filename">sprites/misc/lock_direction_indicator.png</key>
|
||||
<struct type="IndividualSpriteSettings">
|
||||
<key>pivotPoint</key>
|
||||
<point_f>0.5,0.5</point_f>
|
||||
<key>spriteScale</key>
|
||||
<double>1</double>
|
||||
<key>scale9Enabled</key>
|
||||
<false/>
|
||||
<key>scale9Borders</key>
|
||||
<rect>12,12,24,24</rect>
|
||||
<key>scale9Paddings</key>
|
||||
<rect>12,12,24,24</rect>
|
||||
<key>scale9FromFile</key>
|
||||
<false/>
|
||||
</struct>
|
||||
<key type="filename">sprites/misc/storage_overlay.png</key>
|
||||
<struct type="IndividualSpriteSettings">
|
||||
<key>pivotPoint</key>
|
||||
|
@ -1,4 +1,9 @@
|
||||
export const CHANGELOG = [
|
||||
{
|
||||
version: "1.1.16",
|
||||
date: "unreleased",
|
||||
entries: ["Fix belt planner not placing the last belt"],
|
||||
},
|
||||
{
|
||||
version: "1.1.15",
|
||||
date: "17.06.2020",
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user