fezhub / DSP-Mods

Dyson Sphere Program Mods
GNU Lesser General Public License v2.1
42 stars 11 forks source link

IndexOutOfRangeException while copying a building plan #1

Closed Hiestaa closed 3 years ago

Hiestaa commented 3 years ago

Hey and thanks for making this mod! Freaking awesome to scale the factory up without taking a click break every 5min!

I had this issue happening today which I think is related to this mod (see in the error message DSP_Mods.CopyInserters.[...]: image

I reproduced it a couple of time by placing enough solar panels in a row that I had the time to cancel the current building selection, then shift-copy one of the solar panels building plan (not the actual building, but the green ghost that's used as a placeholder until the bot places the building).

I didn't notice any gameplay issue tho, but it's a bit annoying that it disables the auto-save.

If I were to wager a guess, maybe the copied object doesn't exist in the entityPool just yet over there? Might just need to add an early return if the objectid is too large.

Hiestaa commented 3 years ago

Something like that maybe?

cog-videogames commented 3 years ago

I am able to reliably reproduce this when quickly placing several copies of a machine that has several sorters. For example, an assembler that has 3 input and 1 output that is copy-placed six times or so rapidly.

Slowing down a bit, by not placing copies so rapidly, seems to dodge the problem.

Hiestaa commented 3 years ago

I'll give it another try later today, but my experience yesterday was with solar panels (so no sorter). It also happened 100% of the time, no matter how quickly or slowly I copied the building plan (as long as it was still a building plan and not yet a completed building).

kyldvs commented 3 years ago

I believe there are two separate issues, the error with copying unbuilt buildings happens 100% of the time on copy (not when building). Then there is also an error when building several times quickly with a lot of inserters, but that error is sporadic.