Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miner destination error #12

Open
Qsirman opened this issue Oct 31, 2022 · 1 comment
Open

miner destination error #12

Qsirman opened this issue Oct 31, 2022 · 1 comment

Comments

@Qsirman
Copy link

Qsirman commented Oct 31, 2022

image

As you can see. The marked position of source spot is wrong so the miner will take wrong destination.

At around line 150 in file mineral.ts at , you can see the miner take the first position of finded path as it's destination pos but the terrain at this position is wall, so I have to add terrain check to avoid this problem temporily or the miner will hang around source endlessly.

But I think it's someting wrong with path find or there maybe more elegent way to solve this.

please fix it ASAP, thanks.

const [pathResult, details] = getPath(kernel, mineral.pos, basePos, roadPolicy, trace);
if (!pathResult || !pathResult.path.length || new Room.Terrain(mineral.room.name).get(pathResult.path[0].x, pathResult.path[0].y)) {
    trace.error('path not found', { basePos, mineral: mineral.pos, details });
    return;
}
@ryanrolds
Copy link
Owner

Thank you. I will take a look at this issue and the others this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants