mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-08 02:24:07 +00:00
Fix crash in potato mode
This commit is contained in:
parent
47443058e0
commit
ed206363f2
@ -1233,9 +1233,10 @@ export class BeltPath extends BasicSerializableObject {
|
|||||||
this.entityPath.length - 1
|
this.entityPath.length - 1
|
||||||
);
|
);
|
||||||
const medianBelt = this.entityPath[medianBeltIndex];
|
const medianBelt = this.entityPath[medianBeltIndex];
|
||||||
|
const beltComp = medianBelt.components.Belt;
|
||||||
const staticComp = medianBelt.components.StaticMapEntity;
|
const staticComp = medianBelt.components.StaticMapEntity;
|
||||||
const centerPosLocal = medianBelt.components.Belt.transformBeltToLocalSpace(
|
const centerPosLocal = beltComp.transformBeltToLocalSpace(
|
||||||
this.entityPath.length % 2 === 0 ? 1 : 0.5
|
this.entityPath.length % 2 === 0 ? beltComp.getEffectiveLengthTiles() : 0.5
|
||||||
);
|
);
|
||||||
const centerPos = staticComp.localTileToWorld(centerPosLocal).toWorldSpaceCenterOfTile();
|
const centerPos = staticComp.localTileToWorld(centerPosLocal).toWorldSpaceCenterOfTile();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user