diff --git a/rehlds/engine/cmd.cpp b/rehlds/engine/cmd.cpp index 09520bf..4f70e11 100644 --- a/rehlds/engine/cmd.cpp +++ b/rehlds/engine/cmd.cpp @@ -721,7 +721,7 @@ void Cmd_AddCommand(char *cmd_name, xcommand_t function) if (host_initialized) { - Sys_Error(__FUNCTION__ " after host_initialized"); + Sys_Error(__FUNCTION__ ": called after host_initialized"); } // Check in variables list diff --git a/rehlds/engine/delta.cpp b/rehlds/engine/delta.cpp index 268ca07..c68484e 100644 --- a/rehlds/engine/delta.cpp +++ b/rehlds/engine/delta.cpp @@ -1363,13 +1363,13 @@ qboolean DELTA_ParseDescription(char *name, delta_t **ppdesc, char *pstream) if (!ppdesc) { - Sys_Error(__FUNCTION__ " with no delta_description_t\n"); + Sys_Error(__FUNCTION__ ": called with no delta_description_t\n"); } *ppdesc = 0; if (!pstream) { - Sys_Error(__FUNCTION__ " with no data stream\n"); + Sys_Error(__FUNCTION__ ": called with no data stream\n"); } while (true) diff --git a/rehlds/engine/net_ws.cpp b/rehlds/engine/net_ws.cpp index 4a066cf..f590b71 100644 --- a/rehlds/engine/net_ws.cpp +++ b/rehlds/engine/net_ws.cpp @@ -1494,17 +1494,17 @@ void NET_SendPacket(netsrc_t sock, int length, void *data, const netadr_t& to) // let dedicated servers continue after errors if (g_pcls.state == ca_dedicated) { - Con_Printf(__FUNCTION__ " ERROR: %s\n", NET_ErrorString(err)); + Con_Printf(__FUNCTION__ ": ERROR: %s\n", NET_ErrorString(err)); } else { if (err == WSAEADDRNOTAVAIL || err == WSAENOBUFS) { - Con_DPrintf(__FUNCTION__ " Warning: %s : %s\n", NET_ErrorString(err), NET_AdrToString(to)); + Con_DPrintf(__FUNCTION__ ": Warning: %s : %s\n", NET_ErrorString(err), NET_AdrToString(to)); } else { - Sys_Error(__FUNCTION__ " ERROR: %s\n", NET_ErrorString(err)); + Sys_Error(__FUNCTION__ ": ERROR: %s\n", NET_ErrorString(err)); } } } diff --git a/rehlds/engine/pr_cmds.cpp b/rehlds/engine/pr_cmds.cpp index 1ccbc39..e16d502 100644 --- a/rehlds/engine/pr_cmds.cpp +++ b/rehlds/engine/pr_cmds.cpp @@ -1049,7 +1049,7 @@ int EXT_FUNC PF_precache_sound_I(const char *s) return i; } - Host_Error(__FUNCTION__ ": Sound '%s' failed to precache because the item count is over the %d limit.\n" + Host_Error(__FUNCTION__ ": Sound '%s' failed to precache because the item count is over the %d limit.\n" "Reduce the number of brush models and/or regular models in the map to correct this.", s, MAX_SOUNDS); } @@ -2238,56 +2238,56 @@ void EXT_FUNC PF_MessageEnd_I(void) void EXT_FUNC PF_WriteByte_I(int iValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteByte(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteChar_I(int iValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteChar(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteShort_I(int iValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteShort(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteLong_I(int iValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteLong(&gMsgBuffer, iValue); } void EXT_FUNC PF_WriteAngle_I(float flValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteAngle(&gMsgBuffer, flValue); } void EXT_FUNC PF_WriteCoord_I(float flValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteShort(&gMsgBuffer, (int)(flValue * 8.0)); } void EXT_FUNC PF_WriteString_I(const char *sz) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteString(&gMsgBuffer, sz); } void EXT_FUNC PF_WriteEntity_I(int iValue) { if (!gMsgStarted) - Sys_Error(__FUNCTION__ " called with no active message\n"); + Sys_Error(__FUNCTION__ ": called with no active message\n"); MSG_WriteShort(&gMsgBuffer, iValue); } diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index 20e150b..40ecf82 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -423,7 +423,7 @@ void SV_ReallocateDynamicData(void) { if (!g_psv.max_edicts) { - Con_DPrintf(__FUNCTION__ " with sv.max_edicts == 0\n"); + Con_DPrintf(__FUNCTION__ ": sv.max_edicts == 0\n"); return; } diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 9dc339a..28ab3de 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -308,7 +308,7 @@ const char *Sys_FindFirst(const char *path, char *basename) { if (g_hfind != -1) { - Sys_Error(__FUNCTION__ " without close"); + Sys_Error(__FUNCTION__ ": called without close"); } const char *psz = FS_FindFirst(path, &g_hfind, 0); @@ -333,7 +333,10 @@ const char *Sys_FindFirstPathID(const char *path, char *pathid) { //const char *psz;//unused? if (g_hfind != -1) - Sys_Error("Sys_FindFirst without close"); + { + Sys_Error(__FUNCTION__ ": called without close"); + } + return FS_FindFirst(path, &g_hfind, pathid); } diff --git a/rehlds/engine/sys_dll.h b/rehlds/engine/sys_dll.h index c5ec61a..21f4354 100644 --- a/rehlds/engine/sys_dll.h +++ b/rehlds/engine/sys_dll.h @@ -42,9 +42,9 @@ #define __LINE__AS_STRING __HACK_LINE_AS_STRING__(__LINE__) //Gives you the line number in constant string form #if defined _MSC_VER || defined __INTEL_COMPILER -#define NOXREFCHECK __asm { push [ebp + 4] } Sys_Error("[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x") +#define NOXREFCHECK __asm { push [ebp + 4] } Sys_Error("[NOXREFCHECK]: " __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x") #else -#define NOXREFCHECK const char* noxref_msg = "[NOXREFCHECK]:" __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x"; \ +#define NOXREFCHECK const char* noxref_msg = "[NOXREFCHECK]: " __FUNCTION__ " (" __FILE__ ":" __LINE__AS_STRING") NOXREF, but called from 0x%.08x"; \ asm volatile ( \ "pushl 4(%%ebp)\n\t" \ "pushl %0\n\t" \ diff --git a/rehlds/rehlds/hookchains_impl.cpp b/rehlds/rehlds/hookchains_impl.cpp index 07c61c2..0d3949e 100644 --- a/rehlds/rehlds/hookchains_impl.cpp +++ b/rehlds/rehlds/hookchains_impl.cpp @@ -40,11 +40,11 @@ bool AbstractHookChainRegistry::findHook(void* hookFunc) const void AbstractHookChainRegistry::addHook(void* hookFunc, int priority) { if (!hookFunc) { - Sys_Error(__FUNCTION__ " Parameter hookFunc can't be a nullptr"); + Sys_Error(__FUNCTION__ ": Parameter hookFunc can't be a nullptr"); } if (findHook(hookFunc)) { - Sys_Error(__FUNCTION__ " The same handler can't be used twice on the hookchain."); + Sys_Error(__FUNCTION__ ": The same handler can't be used twice on the hookchain."); } for (auto i = 0; i < MAX_HOOKS_IN_CHAIN; i++) @@ -63,7 +63,7 @@ void AbstractHookChainRegistry::addHook(void* hookFunc, int priority) } if (m_NumHooks >= MAX_HOOKS_IN_CHAIN) { - Sys_Error(__FUNCTION__ " MAX_HOOKS_IN_CHAIN limit hit"); + Sys_Error(__FUNCTION__ ": MAX_HOOKS_IN_CHAIN limit hit"); } m_NumHooks++; diff --git a/rehlds/rehlds/rehlds_interfaces_impl.cpp b/rehlds/rehlds/rehlds_interfaces_impl.cpp index b09903f..cbcbe87 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.cpp +++ b/rehlds/rehlds/rehlds_interfaces_impl.cpp @@ -160,7 +160,7 @@ bool EXT_FUNC CRehldsServerStatic::IsLogActive() IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id) { if (id < 0 || id >= g_psvs.maxclients) - Sys_Error(__FUNCTION__": invalid id provided: %d", id); + Sys_Error(__FUNCTION__ ": invalid id provided: %d", id); return g_GameClients[id]; } @@ -168,7 +168,7 @@ IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id) client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id) { if (id < 0 || id >= g_psvs.maxclients) - Sys_Error(__FUNCTION__": invalid id provided: %d", id); + Sys_Error(__FUNCTION__ ": invalid id provided: %d", id); return &g_psvs.clients[id]; } @@ -285,7 +285,7 @@ IGameClient* GetRehldsApiClient(client_t* cl) int idx = cl - g_psvs.clients; if (idx < 0 || idx >= g_psvs.maxclients) { - Sys_Error(__FUNCTION__": Invalid client index %d", idx); + Sys_Error(__FUNCTION__ ": Invalid client index %d", idx); } return g_GameClients[idx];