after hours of investigating a bug report of my mod, I discovered something unexpected: other mods can destroy LuaGuiElement(s) of my mod.
While I could understand that in some situations, it might be convenient for mod A to modify the GUI of mod B, in my situation this is totally unwanted & undesirable. This basically leaves my mod in a corrupted state (causing crashes at some later point, or just letting a player stuck in a surface with no way to leave).
I reported the situation to the author of the mod affecting my GUI, and I'm sure we'll come to a nice solution soon. But I'm afraid this won't be the last time (I've seen other threads of other mods reporting similar issues). Basically I have two possible "solutions" to this problem right now:
- Check on every tick/event that my GUI was not corrupted, and rebuild it if necessary (quite a painful, inefficient & inelegant solution).
- Investigate the next bug reports like this one: find the conflicting mod, and see with its author if he can fix the mod (or mark it as incompatible). Problem is that it still leaves my users with a corrupted game. And the investigation consists in auditing the code of a full modlist (which takes a little too much time for my tastes).