toomuchpete/Grove

Make the blocked-tile handling more generic

toomuchpete opened this issue · 0 comments

Currently there are two places where logic similar to this is used:

if (this.blocked === undefined) {
    this.blocked = 2;
}

if (this.blocked > 0) {
    // Retry
    this.wait = 10;
    this.blocked -= 1;
} else {
    console.log("Plant task cancelled, position blocked");
    Game.Map.removeDesignation(taskPos.x, taskPos.y);
    this.tasks.shift();
}

This should probably be made more generic.