I'm not sure the code you posted actually crashes. IMO it's not executed at all because you don't assign the final value of the computation to a variable. So the compile-time optimization just scraps it and doesn't even include the "if" that's just before.
You must assign your value to a variable.
I have a function that I call in my bot code when I want to crash voluntarily the game at some point.
Code:
void TerminateOnError (const char *fmt, ...)
{
// this function terminates the game because of an error and prints the message string
// pointed to by fmt both in the server console and in a messagebox.
va_list argptr;
char string[1024];
// concatenate all the arguments in one string
va_start (argptr, fmt);
vsprintf (string, fmt, argptr);
va_end (argptr);
// send the error message to console, messagebox, and also in the logfile for developers
ServerConsole_printf ("FATAL ERROR: %s", string); // print to console
MessageBox (0, string, "RACC - Error", NULL); // print to root-level message box
// do we need to close the debug log file ?
if (DebugLevel.fp != NULL)
fclose (DebugLevel.fp); // close the file
DebugLevel.fp = NULL;
// is it better to just exit or shall we crash here to help debugging ?
if (server.developer_level > 0)
string[0] /= (string[0] = 0); // do a nice zero divide error for developers :)
exit (1); // normal exit for non-developers (with error condition)
}
As you can see I use one variable (here the 1st element of the string array) as support for the faulty computation. I couldn't even write " / 0" because the compiler would refuse compiling and complain about a zero divide in the code. That's why I think your "breakpoint" doesn't even work.
If it does perhaps FNullEnt fails to determine the entity pointer is bad.
Every entity is supposed to have a classname. So try doing
Code:
if (STRING (pEdict->v.classname)[0] == 0)
instead of FNullEnt. If the entity pointer is bad, you will read at a forbidden memory location and provoke an access violation anyway, hence a crash, so this is in all cases what you want. And in case it wouldn't want to crash, just append your zero divide to that line.