Walking around in Debug x64 in the starting room crashes reliably with bad char * argument to strstr.
The relevant crash is name being junk data.
// Incursion.exe!denySpell(Monster * m, unsigned int eID) Line 271 C++
const char* name = NAME(eID);
if (strstr(name,"acid") || strstr(name,"vitriolic") ||
(te->ef.eval == EA_BLAST && te->ef.xval == AD_ACID) ||
Putting a breakpoint in this function, the values of name can be observed to be always be junk in Win32 and this is a change in compiler behaviour from VS2015 to VS2022.
Expanding the NAME macro inline and comparing the results of both side by side show the expanded version and the cast operator are working. The following values are correct:
It appears that the cast operation on a ternary expression in 2022 does not classify as an operation on a String object where one of the paths returns a String& and the other a char*. In 2015 it must have.
Walking around in Debug x64 in the starting room crashes reliably with bad
char *
argument tostrstr
.The relevant crash is
name
being junk data.Putting a breakpoint in this function, the values of
name
can be observed to be always be junk in Win32 and this is a change in compiler behaviour from VS2015 to VS2022.Expanding the NAME macro inline and comparing the results of both side by side show the expanded version and the cast operator are working. The following values are correct:
It appears that the cast operation on a ternary expression in 2022 does not classify as an operation on a
String
object where one of the paths returns aString&
and the other achar*
. In 2015 it must have.