mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-12-16 11:41:50 +00:00
slight variable rearranging
This commit is contained in:
parent
fc3de1b586
commit
a239e405c9
@ -43,13 +43,14 @@ export class AcceptorBeltSystem extends GameSystemWithFilter {
|
|||||||
|
|
||||||
const staticComp = entity.components.StaticMapEntity;
|
const staticComp = entity.components.StaticMapEntity;
|
||||||
for (let i = 0; i < acceptorComp.slots.length; ++i) {
|
for (let i = 0; i < acceptorComp.slots.length; ++i) {
|
||||||
|
// Extract underlay parameters
|
||||||
|
const { pos, directions, beltLength } = acceptorComp.slots[i];
|
||||||
|
|
||||||
// skips both missing and 0 belt lengths
|
// skips both missing and 0 belt lengths
|
||||||
if (!acceptorComp.slots[i].beltLength) {
|
if (!beltLength) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract underlay parameters
|
|
||||||
const { pos, directions, beltLength } = acceptorComp.slots[i];
|
|
||||||
const transformedPos = staticComp.localTileToWorld(pos);
|
const transformedPos = staticComp.localTileToWorld(pos);
|
||||||
const destX = transformedPos.x * globalConfig.tileSize;
|
const destX = transformedPos.x * globalConfig.tileSize;
|
||||||
const destY = transformedPos.y * globalConfig.tileSize;
|
const destY = transformedPos.y * globalConfig.tileSize;
|
||||||
|
|||||||
@ -43,13 +43,14 @@ export class EjectorBeltSystem extends GameSystemWithFilter {
|
|||||||
|
|
||||||
const staticComp = entity.components.StaticMapEntity;
|
const staticComp = entity.components.StaticMapEntity;
|
||||||
for (let i = 0; i < ejectorComp.slots.length; ++i) {
|
for (let i = 0; i < ejectorComp.slots.length; ++i) {
|
||||||
|
// Extract underlay parameters
|
||||||
|
const { pos, direction, beltLength } = ejectorComp.slots[i];
|
||||||
|
|
||||||
// skips both missing and 0 belt lengths
|
// skips both missing and 0 belt lengths
|
||||||
if (!ejectorComp.slots[i].beltLength) {
|
if (!beltLength) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract underlay parameters
|
|
||||||
const { pos, direction, beltLength } = ejectorComp.slots[i];
|
|
||||||
const transformedPos = staticComp.localTileToWorld(pos);
|
const transformedPos = staticComp.localTileToWorld(pos);
|
||||||
const destX = transformedPos.x * globalConfig.tileSize;
|
const destX = transformedPos.x * globalConfig.tileSize;
|
||||||
const destY = transformedPos.y * globalConfig.tileSize;
|
const destY = transformedPos.y * globalConfig.tileSize;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user