2 The_Mafia:
In the World Tree (WT) there is a script that changes the terrain in underground battles to the appropriate one; this is the so-called Inferno script (the second to last one in the script91.erm file).
It works as follows: before the battle, it moves the coordinates of the battle location to the surface and changes the terrain type to the required one; after the battle, it restores the old terrain type on the surface cell.
It is likely that on one side, the battle coordinates did not change, which is why the battlefields are different.
I think it would be easier to fix this bug by patching the WT executable. This script was one of the first I created, and it more or less coped with its function when playing without the HD mod. Although, even then, bugs occurred, but I corrected it as I remember.
It should be noted that this script is necessary for mirror templates, so it cannot be completely removed.
You can try asking Wizard how he solved the terrain type problem in underground battles for the Sodo mirror.
In my opinion, many WT incompatibilities with HD are easier to fix on the WT side if that is the goal. In particular, the incompatibility of HD with mirror templates. If anything, the source code for the mirror is still intact.
Thank you. I will try to figure it out.
PS
I assumed that since the bug occurs when the mod is enabled, it is the mod that affects it, in which case I will have to patch the mod itself, possibly its DLLs, and not the executable. That's why I wrote here.
PS 2
Moreover, there is another bug with automatic battles; the essence of it is that when using the mod, after a quick battle with neutrals, you can end up in a new battle on the surface, even though you are in a dungeon. Similar symptoms. I will provide a detailed description of the bug with saves and screenshots later.