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

This subforum contains all the issues which we already resolved.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 260
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

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

Post 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
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post 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?
User avatar
theRustyKnife
Filter Inserter
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

Post 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
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

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

Post 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 :)
Post Reply

Return to “Resolved Problems and Bugs”