glitchassassin / screeps-cartographer

Cartographer is an advanced (and open source) movement library for Screeps
29 stars 8 forks source link

Long Range Pathfinding Not Avoiding rooms #55

Closed mkaulfers closed 1 month ago

mkaulfers commented 1 month ago

I'm using the moveTo while providing a routeCallback. It appears when I return Infinity or a float value, creeps still path through those rooms.

routeCallback(roomName, fromRoomName) {
      const intelligenceData = Memory.intelligenceData
      if (!intelligenceData) return 1

      if (intelligenceData[roomName]?.hostile) {
          console.log(`Creep avoiding hostile room ${roomName}`)
          return Infinity
      }

      return 1
  }
glitchassassin commented 1 month ago

Should be fixed in the latest release!