Page 1 of 1

[Twinsen] [0.14.14] Changes to item_slot_count don't update

Posted: Tue Oct 25, 2016 1:30 pm
by GotLag
I have a mod with a constant-combinator type entity (reactor-interface) that currently has 5 slots. As part of an update I am writing, I have increased item_slot_count in the prototype to 10.

However, when I load an old save I get a lua error from the on_tick event in my control.lua script, as it's trying to write a signal to slot 6 and the existing reactor-interface entities appear to still be treated as if they have 5 slots.
The specific error is "Index out of bounds: 6"

Note that if I comment out the offending line (so I can load the game) and open a reactor-interface GUI it shows 10 slots.

I have a stupid (but apparently working) workaround:
  1. Create a temporary surface
  2. Create a temporary reactor-interface
  3. Iterate over all existing reactor-interfaces and copy the settings from the temporary reactor-interface
  4. Delete the temporary reactor-interface
  5. Delete the temporary surface
This goes in my on_configuration_changed handler.

Re: [Twinsen] [0.14.14] Changes to item_slot_count don't update

Posted: Wed Oct 26, 2016 12:41 pm
by Twinsen
Fixed in Version: 0.14.17

Re: [Twinsen] [0.14.14] Changes to item_slot_count don't update

Posted: Wed Oct 26, 2016 12:44 pm
by GotLag
Cheers!

Re: [Twinsen] [0.14.14] Changes to item_slot_count don't update

Posted: Wed Oct 26, 2016 8:42 pm
by Rseding91
Twinsen wrote:Fixed in Version: 0.14.17
Did you forget to push the fix? :)

Re: [Twinsen] [0.14.14] Changes to item_slot_count don't update

Posted: Thu Oct 27, 2016 10:35 am
by Twinsen
Rseding91 wrote:
Twinsen wrote:Fixed in Version: 0.14.17
Did you forget to push the fix? :)
I did. Pushed now and it will still be in Version: 0.14.17