The documentation says that when you call LuaConstantCombinatorControlBehavior.get_signal on a slot with no signal, nil will be returned.
In reality, it returns something like this: {count = n}, where n is the count of the last signal set in that slot.
Cheers TRK
[posila] [0.15.28] get_signal doesn't return nil when no signal
- theRustyKnife
- Filter Inserter
- Posts: 260
- Joined: Thu Feb 26, 2015 9:26 pm
- Contact:
Re: [0.15.28] get_signal doesn't return nil when no signal
I want to keep the current behavior. Any suggestion how to rephrase the documentation to make it more clear signal in the returned table is nil, not the return value itself?
- theRustyKnife
- Filter Inserter
- Posts: 260
- Joined: Thu Feb 26, 2015 9:26 pm
- Contact:
Re: [posila] [0.15.28] get_signal doesn't return nil when no signal
That's quite tricky... Maybe something like this: Gets the signal at the given index. If there is none, the last known count is returned with nil as the signal.
Also saying that the returned value is a Signal might help.
Why do you want to keep this behavior? Is it useful for anything? I'm not opposed to the idea, just curious.
Cheers TRK
Also saying that the returned value is a Signal might help.
Why do you want to keep this behavior? Is it useful for anything? I'm not opposed to the idea, just curious.
Cheers TRK
Re: [posila] [0.15.28] get_signal doesn't return nil when no signal
Mainly because I don't want to introduce mod breaking change for no good reason at this stage of 0.15theRustyKnife wrote:Why do you want to keep this behavior? Is it useful for anything? I'm not opposed to the idea, just curious.
