Edit: False alarm. I indeed had an infinity (due to dividing with 0 factories) in another part of the code.
/edit
The issue is not that I can't handle a non-numeric value. It's that I don't understand what's going on
at all.
The typical example is like this:
Code: Select all
Mods\DLCSteamRules210217\Orders\tech.lua:82: unexpected non-finite value in recorded table.
Mods\DLCSteamRules210217\Orders\tech.lua:82:gain_beakers:
Mods\DLCSteamRules210217\Orders\economy.lua:511:
Mods\DLCSteamRules210217\@@util\functional_tricks.lua:214:
Mods\DLCSteamRules210217\Orders\end_year.lua:106:
Mods\DLCSteamRules210217\Orders\end_year.lua:267
Line 82:
Neither of these is really infinite, I can perform arithmetic with them just fine without triggering anything:
Code: Select all
local xxxyyy = beakers + 1
local xxxyyyy = empire.extra_science + 1
xxxyyyy = xxxyyyy + xxxyyy
empire.extra_science += beakers
The error is still on the last line.
This all looks like vanilla code to me, too. If I remove the beaker gain entirely, the error just propagates to another part of the end turn code.