Giter Club home page Giter Club logo

Comments (2)

sparr avatar sparr commented on August 19, 2024

Are you sure you aren't using reusePath and the creep has a memorized path that hasn't expired yet?

from engine.

fiher avatar fiher commented on August 19, 2024

I have noticed similar issue. So far it seems that the problem comes from the fact that the path finding for this function returns unfinished path if the location is blocked.

If you are 10 tiles away from your location and only all tiles in range of 1 are blocked the path finder will provide you with path...but it will be one tile short. And your creep will move...1 tile short of its initial destination.

If you are however in range of 2 tiles and all tiles in range of 1 are blocked the path finder will not give you any path...resulting in ERR_NO_PATH being given.

However, this implementation works for sources and other structures on which you can't walk over without providing range:1 property to moveTo.

if(creep.harvest(source) === ERR_NOT_IN_RANGE){ creep.moveTo(source) }

This currently works...you will be given a path 1 tile away from the source...move to it..and stop receiving ERR_NOT_IN_RANGE.

However if this fix is to be implemented such code will return ERR_NO_PATH since there is no path that leads to the exact location (x,y).

In addition if you were to add default range:1 then when moving to flags or containers or any other walkable object...you will stop 1 tile short.

from engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.