jodli / CreativeMod

A creative mode mod for Factorio
https://mods.factorio.com/mod/creative-mod
GNU Lesser General Public License v3.0
14 stars 13 forks source link

Fix script raised event errors / crashes #30

Closed Crow08 closed 4 years ago

Crow08 commented 4 years ago

Since Factorio version 0.18.27 the script.raise_event function was changed to no longer raise all event types. I replaced all unsupported event types with script_raised_* events to prevent errors and crashes.

raimondasv commented 4 years ago

Got an error while trying to place a blueprint

The mod Creative Mod (1.4.1) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event creative-mod::on_tick (ID 0)
Invalid surface name or index.
stack traceback:
    __creative-mod__/scripts/util.lua:161: in function 'raise_event'
    __creative-mod__/scripts/util.lua:258: in function 'raise_event_for_revived_tile_ghosts'
    __creative-mod__/scripts/util.lua:286: in function 'revive_tile_ghost_and_raise_event'
    __creative-mod__/scripts/cheats.lua:2767: in function 'tick'
    __creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>
stack traceback:
    [C]: in function 'raise_event'
    __creative-mod__/scripts/util.lua:161: in function 'raise_event'
    __creative-mod__/scripts/util.lua:258: in function 'raise_event_for_revived_tile_ghosts'
    __creative-mod__/scripts/util.lua:286: in function 'revive_tile_ghost_and_raise_event'
    __creative-mod__/scripts/cheats.lua:2767: in function 'tick'
    __creative-mod__/scripts/events.lua:185: in function <__creative-mod__/scripts/events.lua:154>

Blueprint contained landfill and tiles. Had no problems with other blueprints.