ReikaKalseki / Reika_FactorioMods_Issues

The issue tracker for all of my Factorio mods - EndgameCombat, NauvisDay, Geothermal, Oreverhaul, and the rest.
5 stars 1 forks source link

Geothermal - LuaTile API call when LuaTile was invalid. #281

Closed Nassiel closed 2 years ago

Nassiel commented 4 years ago

Hi,

While using the Factorio 1.0, final release I see this error. You mod is in the 1.18.15. Any extra information that you'd need, please let me know.

Thanks!

LuaTile API call when LuaTile was invalid.
stack traceback:
    __Geothermal__/control.lua:174: in function 'getSpawnData'
    __Geothermal__/control.lua:217: in function 'controlChunk'
    __Geothermal__/control.lua:237: in function <__Geothermal__/control.lua:236>
stack traceback:
    [C]: in function '__index'
    __Geothermal__/control.lua:174: in function 'getSpawnData'
    __Geothermal__/control.lua:217: in function 'controlChunk'
    __Geothermal__/control.lua:237: in function <__Geothermal__/control.lua:236>
ReikaKalseki commented 4 years ago

What mods do you have that change tiles in the world?

numbernegative commented 3 years ago

Also receiving identical error. But only on starting a new game. Adding geothermal to a save already started and loading does not reproduce. Mods that I know change tiles I also have loaded: Krastorio2, Alien Biomes, Space Exploration.

ReikaKalseki commented 3 years ago

It is not AlienBiomes - I use that myself - but does it persist if any of those are removed?

Nassiel commented 3 years ago

I have Alien Biomes and Alien Biomes HD.

ReikaKalseki commented 3 years ago

So do I.

1avek1 commented 3 years ago

I have the same problem.

It happens with BlueprintLab_design_1.0.1 mod when I push the "switch to lab" button. As soon as the Blueprint Lab surface appears, Geothermal crashes the game.

But the problem is not related to any other mods but Geothermal itself. There's a general rule: if Factorio returns some object with .valid field set to false, that object may not be used by mods. The crashing line in Geothermal is: if set[tile.name] then

It's clear that is doesn't check the previous surface.get_tile result. The code must be instead: if tile and tile.valid and set[tile.name] then

When I patch it in this way, the problem with Blueprint Lab special surface is solved - no crash anymore. I haven't yet checked how the rest of Geothermal works with it, though.

ReikaKalseki commented 1 year ago

This has been fixed.