Game Crash On Map Close Fix - Genuine ApseMap.gfx Bugfix

Game Crash On Map Close Fix - Genuine ApseMap.gfx Bugfix

Warhorse broke things in the ApseMap.gfx at some point in the last updates probably. This fix makes the movieclip end when the map exits and it fixes map texture leak and the random crashes.

[size=4][b]Description[/b][/size]
[s][color=#D4D4D8]I have been plagued by crashes strictly when I close the map and nowhere in any search could I find people mention this. By analyzing the dump files of the Warhorse bug submission tool with AI the results always point to some kind of heap corruption, memory corruption, whatever, always something coming from the native executable. It happens to me even with a unmodded setup, all settings reset to default, fresh GPU driver cleanup/reinstall, updated BIOS, reset all my overclocking on CPU/GPU, i mean, I must have tried probably 25 other things. My only conclusion is that it is a problem with one of Warhorses latest updates. Maybe the update that ruined the map with the maximum zoom-in every time you open the map. I dont know. [/color][/s]

[s][color=#D4D4D8]AAaaaaaaaaanyway, [/color][color=#D4D4D8][size=3]TL;DR[/size][/color][color=#D4D4D8]: the momentary solution seemed to be setting wh_ui_apseunloadmode = 0 in user.cfg. The problem is that at 0 when I traded with merchants then my inventory would be completely blank. And at 1 (widely recommended in optimization guides), or 2, or 3, the game crashes when I close the map. So I made my slavebot build a dynamic ui-state based cvar toggle, and it freaking works. No more game crashes on map close, no more blank inventories. And now I can go trot in the forest. Thank you.[/color][/s]

[size=4][b]Installation instructions[/b][/size]
[s][color=#D4D4D8]Like most mods just put 'assunloadfix' in your \Mods\ folder. The path will end up looking like this:
\KingdomComeDeliverance2\Mods\assunloadfix\

[size=3]You must remove wh_ui_apseunloadmode from your custom user.cfg if you've been using one. This mod takes complete control of it.[/size][/color][/s]

[s][color=#D4D4D8]In the ass_unload_fix.cfg you can always try setting auf_safe_mode to 1 and thats what the game will set it at after you enter a UI that is not the map. Its a more aggressive UI unload than mode 2 and all the optimization guides have recommended it since the start, and I used to play with that setting just fine until some update I guess. If you have problems  with UI display or crashes set it back to 2.[/color][/s]


[color=#D4D4D8][size=6]THIS MOD PAGE IS GOING TO BE DELETED IN 48 HOURS AND THE NEW FIX WILL BE UPLOADED TO A NEW MOD PAGE. IT IS CURRENTLY AVAILABLE IN THE DOWNLOAD SECTION.[/size][/color]