Page 1 of 1

[0.16.35] event "on_surface_created" index incorrect

Posted: Wed Mar 28, 2018 12:23 pm
by Mylon
When event "on_surface_created" fires for the first time, the "surface_index" returned is "1". The expected result is "2", as "nauvis" already exists by this point.

Image

The relevant code producing these statements:

Code: Select all

local surface = game.surfaces[event.surface_index]
game.print("Piety: Surface created event parsed for index: " .. event.surface_index .. ", name: " .. surface.name)

Re: [0.16.35] event "on_surface_created" index incorrect

Posted: Wed Mar 28, 2018 1:51 pm
by Rseding91
Thanks for the report. It's now fixed for the next version of 0.16 or 0.17 which ever comes first.