Wrong code applies richness modifier

Replaces resource spawning system, so that the distances between resources are much bigger. Railway is needed then.

Moderators: orzelek, Dark

Post Reply
User avatar
morsk
Fast Inserter
Fast Inserter
Posts: 120
Joined: Fri Dec 15, 2017 1:00 am
Contact:

Wrong code applies richness modifier

Post 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.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Wrong code applies richness modifier

Post 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.

User avatar
fishycat
Filter Inserter
Filter Inserter
Posts: 309
Joined: Thu Apr 09, 2015 7:38 pm
Contact:

Re: Wrong code applies richness modifier

Post 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.

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Wrong code applies richness modifier

Post by orzelek »

Previous fix was non-trivial and it seems I missed small hack thats used for this setting.
Fixed in new version.

User avatar
fishycat
Filter Inserter
Filter Inserter
Posts: 309
Joined: Thu Apr 09, 2015 7:38 pm
Contact:

Re: Wrong code applies richness modifier

Post by fishycat »

Nice, thanks for the quick fix.

Post Reply

Return to “Resource Spawner Overhaul”