Skip to content

fix crash if curved rail has no items_to_place_this#110

Open
daviscook477 wants to merge 1 commit intoChoumiko:masterfrom
daviscook477:master
Open

fix crash if curved rail has no items_to_place_this#110
daviscook477 wants to merge 1 commit intoChoumiko:masterfrom
daviscook477:master

Conversation

@daviscook477
Copy link
Copy Markdown

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