Redid case on some error messages

Really minor things in EventManager

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40587
This commit is contained in:
Scott Ehlert 2007-03-06 07:38:19 +00:00
parent c256741488
commit e6a127ac17
4 changed files with 29 additions and 29 deletions

View File

@ -25,7 +25,7 @@ typedef List<EventHook *> 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();

View File

@ -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<EventInfo *> m_FreeEvents;
};

View File

@ -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<funcid_t>(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<funcid_t>(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();

View File

@ -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;