lep / jassdoc

Document the WarCraft 3 API
52 stars 20 forks source link

CreateRegion and maybe other natives lead to crashes when saving games when used in globals #162

Open tdauth opened 1 month ago

tdauth commented 1 month ago

See https://www.hiveworkshop.com/threads/list-of-warcraft-iii-crashes.194706/page-4#post-3637812 Would be worth mentioning?

Besides, can this tool be integrated in TESH? I guess map creators will write JASS/vJass code mostly with TESH and it would be helpful to have all the information there.

Luashine commented 1 month ago

Of course it's a good idea, that's what jassdoc is for.

We have had autocompletion generated for N++ by @Leyki here - https://www.hiveworkshop.com/threads/notepad-jass-vjass-syntax-highlighter-2023-v8.341147/#post-3611176

TESH has a sqlite db for this, I haven't yet had time to integrate GUI descriptions into our own sqlite yet. After a little back and forth, it'll be worth to start proper support for IDE integration.


Having this in the map script:

JASS:Copy globals region r = CreateRegion() endglobals

Leads to the game crashing when saving it. Took me some time to find this cause. Regions must be initialized in some function instead.

Also when loading save games in Reforged framehandles become invalid and accessing them will crash the game. Hence, they must be recreated after loading a game before being accessed again. Systems like FrameLoader help with this issue.