(May 7th, 2017, 05:37)Soul Reaver Wrote: More mid-battle testing.
I waited until the game hung, then gradually increased Beastmaster's available mana by 1 and put him back on 'ready' until he'd do something (this took a lot of tries as the MP reverts back to the previous figure unless you get lucky with the timing).
Once he reached 10 mana, he casts a spell. If Torin has an enchantment on him, Beastmaster casts Dispel Magic True on Torin. This made me curious to see what would happen if Torin didn't have an enchantment on him, so I repeated the test. Same as before, except at 10 MP Beastmaster cast Counter Magic, which for some odd reason then didn't come up at all in the battlefield spells display.
Any way to tell which spell the hero is casting (or trying to cast) in combat?
None, that's why it's crashing. I mean, the hero queues "cast a spell", but picks the spell when the action is executed. If it finds nothing to cast, it goes back to selecting an action and this time cannot pick casting a spell - but for some reason it does again anyway.
CoM doesn't have this problem because it was modified to only queue casting a spell if the spell that would be picked has a priority of 10+ to cast, but this modification was most likely incomaptible.
At least this is what I suspect but I found one more block of code that wasn't copied over and might be related :

If this helps, good. If not, this is a last-resort solution :

Oh, and this is also different :

...wait, the 151RC5 file has something completely different from the original and the latest, correctly working version. This will unset the "don't pick spell again" state and cause exactly the bug you experience.
This last file should be the one solving the problem (but probably won't hurt to include the others as well)