Something is calling this function with an invalid value (-1). Unfortunately, I'm having trouble tracking down the caller (according to the debugger it's __ehhandler$?canCast@CvUnit@@QAE_NH@Z: - if that helps). In any case, an invalid value should always return false (it doesn't).
I added the following code to the beginning of this function:
I added the following code to the beginning of this function:
Code:
// Smarter Orcs defect fix begin.
if ((spell < 0) || (spell >= GC.getNumSpellInfos()))
{
return false;
}
// Smarter Orcs end