mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-21 16:13:57 +00:00
Whoops
This commit is contained in:
parent
0f2ae44de0
commit
ed16506ab2
1 changed files with 22 additions and 12 deletions
|
@ -417,20 +417,30 @@ const factory = createLayer(id, () => {
|
|||
|
||||
let yInc = 0;
|
||||
let xInc = 0;
|
||||
if (components.value[x + "x" + (y + 1)]?.type === "conveyor") {
|
||||
if (components.value[x + "x" + (y + 1)].direction === Direction.Up) {
|
||||
yInc = 1;
|
||||
} else if (components.value[x + "x" + (y - 1)].direction === Direction.Down) {
|
||||
yInc = -1;
|
||||
} else if (components.value[x + 1 + "x" + y].direction === Direction.Right) {
|
||||
xInc = 1;
|
||||
} else if (components.value[x - 1 + "x" + y].direction === Direction.Left) {
|
||||
xInc = -1;
|
||||
}
|
||||
if (
|
||||
components.value[x + "x" + (y + 1)]?.type === "conveyor" &&
|
||||
components.value[x + "x" + (y + 1)].direction === Direction.Up
|
||||
) {
|
||||
yInc = 1;
|
||||
} else if (
|
||||
components.value[x + "x" + (y - 1)]?.type === "conveyor" &&
|
||||
components.value[x + "x" + (y - 1)].direction === Direction.Down
|
||||
) {
|
||||
yInc = -1;
|
||||
} else if (
|
||||
components.value[x + 1 + "x" + y]?.type === "conveyor" &&
|
||||
components.value[x + 1 + "x" + y].direction === Direction.Right
|
||||
) {
|
||||
xInc = 1;
|
||||
} else if (
|
||||
components.value[x - 1 + "x" + y]?.type === "conveyor" &&
|
||||
components.value[x - 1 + "x" + y].direction === Direction.Left
|
||||
) {
|
||||
xInc = -1;
|
||||
}
|
||||
// no suitable location to dump stuff in
|
||||
//console.log(x, y)
|
||||
//debugger;
|
||||
console.log(x, y);
|
||||
debugger;
|
||||
if (xInc === 0 && yInc === 0) continue;
|
||||
let itemToMove: [string, number] | undefined = undefined;
|
||||
for (const [name, amt] of Object.entries(data.productionStock)) {
|
||||
|
|
Loading…
Reference in a new issue