Giter Club home page Giter Club logo

factorio-ordered-rich-text-train-stops's People

Watchers

 avatar  avatar

factorio-ordered-rich-text-train-stops's Issues

Schedule broken when opening a train stopped at a disabled stop

When a stop is disabled (or has a train limit of 0), no trains are permitted to be dispatched to it. However, a train that is already at that stop is allowed to remain there.

When this mod makes a train scan train stops to check whether they are accessible, it does so by temporarily modifying its schedule. When it's done it removes the temporary stops it added and instructs the train to go to its previous destination. For a stopped train, this will be the station it is stopped at.

Because a train cannot be instructed to go to a stop that is disabled, if it was stopped at a disabled stop, it will enter a broken state where it waits for the stop that it is currently at to become enabled so that it can leave the stop and pathfind directly back to it. When the stop is enabled based on circuit behaviour this may not always be possible and risks deadlocking the network.

A fix should involve the scanning solution being changed to not touch a train's schedule at all. As a suggestion, a virtual train could be created at the same position as the current train, have the stops checked for accessibility, and then be destroyed. Alternatively, the base game's logic might already be exposed as an API that I missed.

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.