GDIW - Gah! DarnItWater!


Allows switching liquid recipe inputs and outputs.

Utilities
3 years ago
0.13 - 1.1
44.0K

i Possible further simplification of 0.14.11

7 years ago
(updated 7 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.

This thread has been locked.