Page 1 of 1

[posila] [0.15.28] get_signal doesn't return nil when no signal

Posted: Sun Jul 09, 2017 5:06 pm
by theRustyKnife
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

Re: [0.15.28] get_signal doesn't return nil when no signal

Posted: Tue Jul 11, 2017 12:25 pm
by posila
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?

Re: [posila] [0.15.28] get_signal doesn't return nil when no signal

Posted: Tue Jul 11, 2017 6:08 pm
by theRustyKnife
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

Re: [posila] [0.15.28] get_signal doesn't return nil when no signal

Posted: Thu Jul 13, 2017 10:23 am
by posila
theRustyKnife wrote:Why do you want to keep this behavior? Is it useful for anything? I'm not opposed to the idea, just curious.
Mainly because I don't want to introduce mod breaking change for no good reason at this stage of 0.15 :)