Skip to content

Commit

Permalink
building protection for mineral-adjacent positions
Browse files Browse the repository at this point in the history
  • Loading branch information
CarsonBurke committed Dec 4, 2023
1 parent 3c633ff commit 913ce3e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/international/garbageCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { packCache, unpackCache } from 'other/codec'
*/
export class GarbageCollector extends Sleepable {
// Clean rooms that haven't been scouted in 100k ticks
cleanRoomThreshold = 100000
cleanRoomThreshold = 300000
sleepFor = 100000
run() {
if (this.isSleepingResponsive()) return
Expand Down
1 change: 1 addition & 0 deletions src/room/commune/spawning/spawnRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ export class SpawnRequestsManager {
minCost,
}
}

// there are no haulers, consider that in spawning cost limitations

return {
Expand Down
1 change: 1 addition & 0 deletions src/room/communePlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,7 @@ export class CommunePlanner {
const packedCoord = packAsNum(adjPos)
if (this.terrainCoords[packedCoord] === 255) continue

this.roadCoords[packedCoord] = 20
this.baseCoords[packedCoord] = 255
mineralHarvestPositions.push(adjPos)
}
Expand Down
2 changes: 1 addition & 1 deletion src/room/creeps/roleManagers/commune/hauler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Hauler extends Creep {
}

const creepMemory = Memory.creeps[this.name]
if (creepMemory[CreepMemoryKeys.previousRelayer] && creepMemory[CreepMemoryKeys.previousRelayer][1] - 1 > Game.time) {
if (creepMemory[CreepMemoryKeys.previousRelayer] && Game.time > creepMemory[CreepMemoryKeys.previousRelayer][1] + 1) {

creepMemory[CreepMemoryKeys.previousRelayer] = undefined
}
Expand Down

0 comments on commit 913ce3e

Please sign in to comment.