Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1862/autorouter] Fix freight trains not being able to auto route #11020

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 7, 2024

  1. [1862/autorouter] Fix freight trains not being able to auto route

    A minimal repro is here: https://gist.github.com/PistonPercy/dbbad162540451e8941dfae3e57ccbc9
    
    ```
    Uncaught []: undefined method `[]' for nil
    Caused by: Object { … }
    klass runtime.js:589
    $Exception_new$1 error.rb:12
    $$method_missing basic_object.rb:146
    method_missing_stub runtime.js:1563
    $$adjust_end game.rb:1618
    $$hex_crow_distance game.rb:1631
    $$freight_revenue game.rb:1671
    $$revenue_for game.rb:1676
    ```
    
    which is originating from this line: https://github.com/tobymao/18xx/blob/master/lib/engine/game/g_1862/game.rb#L1618
    
    The issue is the chains from the auto router don't have :hexes, but this code
    expects there to be. I'm not sure if :hexes is suppose to be there or the other
    side should be tweaked.
    PistonPercy committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    9527af5 View commit details
    Browse the repository at this point in the history