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

fix crash if curved rail has no items_to_place_this #110

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

Conversation

daviscook477
Copy link

when checking "straight-rail" there is a check on "proto.items_to_place_this" before then trying to use pairs on "proto.items_to_place_this"

however when checking "curved-rail" there is no check on "proto.items_to_place_this" before then trying to use pairs on "proto.items_to_place_this"

this means that when another mod adds a type of rail for which there is no item to place it, FARL crashes with the following error:

Please report this error to the mod author.

Error while running event FARL::on_init()
__FARL__/control.lua:79: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
    [C]: in function 'pairs'
    __FARL__/control.lua:79: in function 'getRailTypes'
    __FARL__/control.lua:228: in function <__FARL__/control.lua:222>

this PR adds the missing check to the "curved-rail" line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant