mspielberg / factorio-railloader

Rapidly load and unload trains of bulk materials.
GNU Lesser General Public License v3.0
9 stars 19 forks source link

Py graded ores are not supported #47

Open logisticsbot opened 1 year ago

logisticsbot commented 1 year ago

Hi, firstly many thanks for sharing your mod, it is great!

One minor issue that I am having is that the "graded" ores in pyrawores are not classified as ores, and only work if the mod settings are changed to allow any item.

This seems to be due to a bad pattern "^(low%-|high%-)grade%-" in bulk.lua. Unfortunately lua string.find does not support alternatives with this pipe syntax, and there are some graded ores that do not have a "high-" or "low-" prefix that I think should also be matched.

Changing this to match on the prefixes grade-, low-grade- and high-grade- individually seems to fix the issue for me locally and I think would be useful for other Py players, so I'll raise this fix as a PR for your consideration. Thanks!

logisticsbot commented 1 year ago

I have since found that antimony ores from pyAE do not fit this pattern, since they use sb-grade- as a prefix. Relaxing the above to match either grade- (at the start) or -grade- (anywhere) resolves this and is hopefully also more future-proof!

I have updated the PR #48 to use just these two matches. Thanks!