[0.16.45] on_gui_closed event not fired

Bugs that are actually features.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

[0.16.45] on_gui_closed event not fired

Post by osldgoth »

To reproduce: Build and open the gui of an assembler(1, 2 or 3), quick replace assembler to another level (3, 1, 2). gui will close but the event on_gui_closed will not be called. I have a mod https://mods.factorio.com/mod/Actual_Craft_Time that relies on this event. I expect either the gui to remain open or the event to be called. This also is true for stone and steel furnaces. As the event is not fired, a gui in my mod doesn't close and causes the game to crash when a new gui tries to be created as both will have the same name. I'll need to add a check if this is to be not fixed.
Attachments
factorio-current.log
The log doesn't show anything about event calls, just the mod causing a crash which isn't useful.
(14.41 KiB) Downloaded 84 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 16101
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.16.45] on_gui_closed event not fired

Post by Rseding91 »

Thanks for the report however this is working correctly. It's even documented on the event: http://lua-api.factorio.com/latest/even ... gui_closed
Note: This is only called if the player explicitly closed the GUI.
This is a limitation of how the game works when it comes to GUIs. The same behavior happens if you kill or call destroy() on the open entity.
If you want to get ahold of me I'm almost always on Discord.
osldgoth
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Thu Feb 26, 2015 3:52 am
Contact:

Re: [0.16.45] on_gui_closed event not fired

Post by osldgoth »

Very well, I'll make changes to my mod.
Post Reply

Return to “Not a bug”