Page 1 of 1
[1.1] resource_autoplace isn't global anymore
Posted: Tue Nov 24, 2020 2:00 pm
by bobingabout
After the huge clusterF* when the resource_autoplace system was introduced in the first place, part of the solution was to leave resource_autoplace in resources.lua as global INTENTIONALLY, to make it easier for mods to use it.
This was because when you reload it from a different mod, any locals set in the file are reset, so ore index numbers end up being re-used when they're not supposed to be.
In 1.1, it has been changed back to a local.
Re: [1.1] resource_autoplace isn't global anymore
Posted: Tue Nov 24, 2020 2:05 pm
by Deadlock989
The change for me was to add one line:
Code: Select all
local resource_autoplace = require("resource-autoplace")
Re: [1.1] resource_autoplace isn't global anymore
Posted: Tue Nov 24, 2020 2:07 pm
by bobingabout
Deadlock989 wrote: Tue Nov 24, 2020 2:05 pm
The change for me was to add one line:
Code: Select all
local resource_autoplace = require("resource-autoplace")
I'll give it a try include it again anyway and see if there are any issues with it. (i'm just going to include it as a global in my library, as I call it too many places to want to try and fix them all.)
Re: [1.1] resource_autoplace isn't global anymore
Posted: Tue Nov 24, 2020 2:42 pm
by bobingabout
Well, it does seem to work with just including it.
I'll be back if I find any issues related to the change.
Re: [1.1] resource_autoplace isn't global anymore
Posted: Tue Nov 24, 2020 2:48 pm
by Bilka
Not a bug, change was mentioned in
viewtopic.php?p=521904#p521904. If an problem crops up other than like the variables resetting as you mention, please let us know.