GDIW - Gah! DarnItWater!

Allows switching liquid recipe inputs and outputs.
10 days ago
0.13 - 0.17
34461

i Possible further simplification of 0.14.11

- 2 years ago
(updated 2 years ago)

Yesterday evening I read the Lua specs on tables, and looking at the change in today's 0.14.11, I think the affected lines may be streamlined even further:

<pre>elseif vrn.results then if vrn.results[1].type == "item" or vrn.results[1].type == "fluid" then table.insert(newicons,{icon=data.raw[vrn.results[1].type][vrn.results[1].name].icon}) end </pre>

Or, if you can be certain that it's either one type or the other, due to prior filtering, you could even lose the inner if-clause entirely.

<pre>elseif vrn.results then table.insert(newicons,{icon=data.raw[vrn.results[1].type][vrn.results[1].name].icon}) </pre>

This seems to work fine with my setup, but I haven't read through the entire code file (let alone the game base), so I can't be sure whether a result that is neither "fluid" or "item" is a possibility.