ryanrolds / screeps-bot-choreographer

A bot for Screeps
MIT License
11 stars 0 forks source link

miner destination error #12

Open Qsirman opened 2 years ago

Qsirman commented 2 years ago

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 commented 2 years ago

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