[0.15.23] Lua "stale print" crash

This subforum contains all the issues which we already resolved.
Endwashere
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Apr 29, 2017 1:22 am
Contact:

[0.15.23] Lua "stale print" crash

Post by Endwashere »

Not realizing I could simply use "game.print", I tried preserving the player's personal print function to be used in an event handler, like so:

/c local print=game.player.print script.on_event(defines.events.on_player_crafted_item, function() print("hello") end)

It could be any event, presumably (I first caused it using on_research_finished), but for this example crafting an item will then reliably cause the game to crash, even on a brand new map without any running mods.

I doubt this would be considered very high priority, but hey, a crash is a crash.
Endwashere
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Apr 29, 2017 1:22 am
Contact:

Re: [0.15.23] Lua "stale print" crash

Post by Endwashere »

Rseding91
Factorio Staff
Factorio Staff
Posts: 14250
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.23] Lua "stale print" crash

Post by Rseding91 »

Thanks for the report. This is however a known limitation of how the Lua API works in Factorio. I could stop it from crashing but it would lead to save corruption if the game was ever saved in that state so the crashing is better.

Simply don't do that if you don't want it to crash :)
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”