AvHAssert.cpp

 include "../util/nowarnings.h"
include
include
//@2014 is Zassert evil?
//#include "../util/Zassert.h"
ifdef AVH_SERVER
include "../dlls/extdll.h"
include "../dlls/util.h"
include "../dlls/cbase.h"
extern cvar_t avh_assert;
endif
ifdef AVH_CLIENT
endif
include "assert.h"
ifdef DEBUG
void
DBG_AssertFunction(
bool fExpr,
const char* szExpr,
const char* szFile,
int szLine,
const char* szMessage)
{
if (fExpr)
return;
char szOut[512];
if (szMessage != NULL)
sprintf(szOut, "ASSERT FAILED: %s (%s@%d)\n%s", szExpr, szFile, szLine, szMessage);
else
sprintf(szOut, "ASSERT FAILED: %s (%s@%d)\n", szExpr, szFile, szLine);
#ifdef AVH_SERVER ALERT(at_logged, szOut); // Ability to disable ASSERTs on server if(avh_assert.value == 0.0f) { UTIL_ClientPrintAll(HUD_PRINTNOTIFY, szOut); return; } ALERT(at_console, szOut); #endif #ifdef WIN32 _assert((void*)szExpr, (void*)szFile, szLine); #else assert(fExpr); #endif }
endif // DEBUG