raiguard / RecipeBook

Recipe Book for Factorio.
MIT License
20 stars 9 forks source link

Crash when remove a mod with items #59

Closed jerjako closed 3 years ago

jerjako commented 3 years ago

Describe the Bug

When I remove mod with items (in my case: "ExpressBus" and "Nanobots") The game crash when I load the game

To Reproduce

Start a map with ExpressBus, open RecipeBook, save, remove the mod and load the map again without activating ExpressBus

Log

Le mod Recipe Book (Livre des recettes) (3.0.1) a engendré une erreur non récupérable.
Merci d'informer l'auteur de cette erreur.

Error while running event RecipeBook::on_load()
LuaItemPrototype API call when LuaItemPrototype was invalid.
stack traceback:
    [C]: in function '__index'
    __RecipeBook__/scripts/processors/item.lua:16: in function <__RecipeBook__/scripts/processors/item.lua:9>
    (...tail calls...)
    __RecipeBook__/scripts/recipe-book.lua:47: in function 'build'
    __RecipeBook__/control.lua:113: in function <__RecipeBook__/control.lua:106>

I think this is happening because of the new cache feature of the 3.0?

raiguard commented 3 years ago

Oh eff. I thought that the prototypes would remain valid until the end of on_load. That's really annoying. I'll fix this for the next version.

raiguard commented 3 years ago

Thanks for the report, fixed for the next version.