Page 1 of 1

Wrong code applies richness modifier

Posted: Sun Apr 29, 2018 6:24 pm
by morsk
Sorry if I'm reporting this in the wrong place. Also I only know Lua, almost nothing about Factorio modding.

Image

This probably meant to do "res_conf.type" instead of "type". The latter is a function reference, and will always compare unequal to those strings.

But my resources are still getting their richness modded somehow. And fixing this might end up applying the richness modifier twice. I don't understand that part of things.

Re: Wrong code applies richness modifier

Posted: Sun Apr 29, 2018 8:10 pm
by orzelek
Tbh I find lua to be strange... might be that I'm to used to strongly typed languages.

It should be res_conf for sure. Thanks for the find.
This means that it doesn't apply richness from map settings. And it can be hard to test since patch amounts are pretty random. I'll fix it and release new version soon. Some people might suddenly find out that new patches after the fix have more or less ore if they used richness setting.

It was actually worse then this - those values were calculated here but not used later on.. opsie.
All fixed up in new version.

Re: Wrong code applies richness modifier

Posted: Mon Apr 30, 2018 10:19 am
by fishycat
After the update the setting "oil in starting area" seems to be borked. It gets always placed, no matter if the setting is ticked or not.

Re: Wrong code applies richness modifier

Posted: Mon Apr 30, 2018 1:13 pm
by orzelek
Previous fix was non-trivial and it seems I missed small hack thats used for this setting.
Fixed in new version.

Re: Wrong code applies richness modifier

Posted: Mon Apr 30, 2018 1:26 pm
by fishycat
Nice, thanks for the quick fix.