[0.11.5] getcircuitcondition redux

This subforum contains all the issues which we already resolved.
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

[0.11.5] getcircuitcondition redux

Post by Kikkers »

From the update notes:
kovarex wrote:
  • Fixed that LuaEntity::getcircuitcondition crashed the game for entities with non-zero condition, but no connection to the circuit network.
I think this fix triggered something else going wrong. I'm getting crashes when modifying circuit conditions while this function is called each tick.
Specifically, if I select a condition that evaluates to true where it was previously false, the game crashes.


It still only occurs in my mod, normal smart inserters are unaffected.
Last edited by Kikkers on Fri Dec 05, 2014 6:43 pm, edited 1 time in total.
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.11.4] getcircuitcondition redux

Post by kovarex »

Can you provide a reproducible scenario?
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [0.11.4] getcircuitcondition redux

Post by Kikkers »

Hmm, it seems that the exact same sequence does not always trigger the crash. I'll try to be more specific, give me a sec to test stuff, getcircuitcondition might not be the function to blame.
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [0.11.4] getcircuitcondition redux

Post by Kikkers »

Okay, my assumption was wrong. It happens on a different function, either disconnectneighbour or connectneighbour. Not sure which one though, I've isolated this piece of code, which is executed each tick:

Code: Select all

	data[3].disconnectneighbour()
	data[3].disconnectneighbour(0)
	data[3].disconnectneighbour(1)
	data[3].connectneighbour(data[4]) -- copper
	data[3].connectneighbour(data[4], 0) -- red
	data[3].connectneighbour(data[4], 1) -- green
(data[3] and data[4] are entities of type electric-pole)

This works for a few ticks, then the game crashes.

Edit: While not really the right place to suggest it, but I would really like disconnectneighbour to optionally take a pole as an argument, so we can more easily remove only one specific connection.
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.11.5] getcircuitcondition redux

Post by kovarex »

There was an error in the disconnectRed, disconnectGreen method related to this bugreport: https://forums.factorio.com/forum/vie ... =30&t=7122

I strongly believe that the bugfix should fix this problem as well (in 0.11.6), let me know if it isn't the case.
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [0.11.5] getcircuitcondition redux

Post by Kikkers »

Looks like this doesn't trigger the crash anymore, consider this bug fixed (for now).

And also looks like you changed the behavior of the connect and disconnect funtions to now allow smart inserters as arguments. Glad you changed that, but I'll need to patch that in the mod :)
(I'm curious though, was this an intentional change? I can't find it in the patch notes. Kinda assuming it slipped your mind to mention it.)
Kikkers
Fast Inserter
Fast Inserter
Posts: 109
Joined: Sun Jun 22, 2014 8:45 pm
Contact:

Re: [0.11.5] getcircuitcondition redux

Post by Kikkers »

Apparently this change in behavior actually broke my mod in a very minor way, but it comes down to the following:

I need to be able to disconnect and connect each connected wire. This requires the neighbours list to iterate over. This worked previously, but now, because you can't actually find a smart inserter in the neighbours list, this won't work in conjunction with the changes.

I hope you will soon be able to add smart inserters to the neighbours list as well (I'm guessing that will become necessary in 0.12.x anyway).
Post Reply

Return to “Resolved Problems and Bugs”