From e6a127ac17592207249546f7d8cfa573f725cd45 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Tue, 6 Mar 2007 07:38:19 +0000 Subject: [PATCH] Redid case on some error messages Really minor things in EventManager --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40587 --- core/EventManager.cpp | 2 +- core/EventManager.h | 4 ++-- core/smn_console.cpp | 30 +++++++++++++++--------------- core/smn_events.cpp | 22 +++++++++++----------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/core/EventManager.cpp b/core/EventManager.cpp index 91cde171..f40a1f2c 100644 --- a/core/EventManager.cpp +++ b/core/EventManager.cpp @@ -25,7 +25,7 @@ typedef List EventHookList; const ParamType GAMEEVENT_PARAMS[] = {Param_Cell, Param_String, Param_Cell}; -EventManager::EventManager() : m_EventCopy(NULL), m_NotifyPlugins(true) +EventManager::EventManager() : m_EventType(0), m_NotifyPlugins(true), m_EventCopy(NULL) { /* Create an event lookup trie */ m_EventHooks = sm_trie_create(); diff --git a/core/EventManager.h b/core/EventManager.h index 8e91bc86..a6a923e7 100644 --- a/core/EventManager.h +++ b/core/EventManager.h @@ -100,10 +100,10 @@ private: // IGameEventManager2 hooks bool OnFireEvent_Post(IGameEvent *pEvent, bool bDontBroadcast); private: HandleType_t m_EventType; - Trie *m_EventHooks; bool m_NotifyPlugins; - IGameEvent *m_EventCopy; const char *m_EventName; + IGameEvent *m_EventCopy; + Trie *m_EventHooks; CStack m_FreeEvents; }; diff --git a/core/smn_console.cpp b/core/smn_console.cpp index b0de00c0..e76b6273 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -67,7 +67,7 @@ static cell_t sm_HookConVarChange(IPluginContext *pContext, const cell_t *params if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } g_ConVarManager.HookConVarChange(pContext, pConVar, static_cast(params[2])); @@ -84,7 +84,7 @@ static cell_t sm_UnhookConVarChange(IPluginContext *pContext, const cell_t *para if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } g_ConVarManager.UnhookConVarChange(pContext, pConVar, static_cast(params[2])); @@ -101,7 +101,7 @@ static cell_t sm_GetConVarBool(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } return pConVar->GetBool(); @@ -116,7 +116,7 @@ static cell_t sm_GetConVarInt(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } return pConVar->GetInt(); @@ -132,7 +132,7 @@ static cell_t sm_SetConVarNum(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } pConVar->SetValue(params[2]); @@ -149,7 +149,7 @@ static cell_t sm_GetConVarFloat(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } float value = pConVar->GetFloat(); @@ -166,7 +166,7 @@ static cell_t sm_SetConVarFloat(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } float value = sp_ctof(params[2]); @@ -184,7 +184,7 @@ static cell_t sm_GetConVarString(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetString(), NULL); @@ -201,7 +201,7 @@ static cell_t sm_SetConVarString(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } char *value; @@ -221,7 +221,7 @@ static cell_t sm_GetConVarFlags(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } return pConVar->GetFlags(); @@ -236,7 +236,7 @@ static cell_t sm_SetConVarFlags(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } pConVar->SetFlags(params[2]); @@ -253,7 +253,7 @@ static cell_t sm_GetConVarMin(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } cell_t *addr; @@ -277,7 +277,7 @@ static cell_t sm_GetConVarMax(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } cell_t *addr; @@ -301,7 +301,7 @@ static cell_t sm_GetConVarName(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } pContext->StringToLocalUTF8(params[2], params[3], pConVar->GetName(), NULL); @@ -318,7 +318,7 @@ static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_ConVarManager.GetHandleType(), NULL, (void **)&pConVar)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid ConVar Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err); } pConVar->Revert(); diff --git a/core/smn_events.cpp b/core/smn_events.cpp index cc35a804..96e52598 100644 --- a/core/smn_events.cpp +++ b/core/smn_events.cpp @@ -89,7 +89,7 @@ static cell_t sm_FireEvent(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } /* If identities do not match, don't fire event */ @@ -116,7 +116,7 @@ static cell_t sm_CancelCreatedEvent(IPluginContext *pContext, const cell_t *para if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } /* If identities do not match, don't cancel event */ @@ -141,7 +141,7 @@ static cell_t sm_GetEventName(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } pContext->StringToLocalUTF8(params[2], params[3], pInfo->pEvent->GetName(), NULL); @@ -158,7 +158,7 @@ static cell_t sm_GetEventBool(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -176,7 +176,7 @@ static cell_t sm_GetEventInt(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -194,7 +194,7 @@ static cell_t sm_GetEventFloat(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -214,7 +214,7 @@ static cell_t sm_GetEventString(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -234,7 +234,7 @@ static cell_t sm_SetEventBool(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -254,7 +254,7 @@ static cell_t sm_SetEventInt(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -274,7 +274,7 @@ static cell_t sm_SetEventFloat(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key; @@ -295,7 +295,7 @@ static cell_t sm_SetEventString(IPluginContext *pContext, const cell_t *params) if ((err=g_HandleSys.ReadHandle(hndl, g_EventManager.GetHandleType(), NULL, (void **)&pInfo)) != HandleError_None) { - return pContext->ThrowNativeError("Invalid GameEvent Handle %x (error %d)", hndl, err); + return pContext->ThrowNativeError("Invalid game event handle %x (error %d)", hndl, err); } char *key, *value;