Fixed up some error messages...

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40475
This commit is contained in:
Scott Ehlert 2007-02-12 05:46:00 +00:00
parent 2747f06eb7
commit dd9b575853
3 changed files with 6 additions and 7 deletions

View File

@ -259,7 +259,7 @@ void CConVarManager::HookConVarChange(IPluginContext *pContext, ConVar *cvar, fu
// This shouldn't happen... // This shouldn't happen...
if (func == NULL) if (func == NULL)
{ {
pContext->ThrowNativeError("Invalid function: %d", funcid); pContext->ThrowNativeError("Invalid function specified");
return; return;
} }
@ -302,7 +302,7 @@ void CConVarManager::UnhookConVarChange(IPluginContext *pContext, ConVar *cvar,
// This shouldn't happen... // This shouldn't happen...
if (func == NULL) if (func == NULL)
{ {
pContext->ThrowNativeError("Invalid function: %d", funcid); pContext->ThrowNativeError("Invalid function specified");
return; return;
} }
@ -315,14 +315,14 @@ void CConVarManager::UnhookConVarChange(IPluginContext *pContext, ConVar *cvar,
// If the forward doesn't exist, we can't unhook anything // If the forward doesn't exist, we can't unhook anything
if (fwd == NULL) if (fwd == NULL)
{ {
pContext->ThrowNativeError("Convar \"%s\" has no active hook.", cvar->GetName()); pContext->ThrowNativeError("Convar \"%s\" has no active hook", cvar->GetName());
return; return;
} }
// Remove the function from the forward's list // Remove the function from the forward's list
if (!fwd->RemoveFunction(func)) if (!fwd->RemoveFunction(func))
{ {
pContext->ThrowNativeError("Function %d is not a valid hook callback for convar \"%s\"", funcid, cvar->GetName()); pContext->ThrowNativeError("Invalid hook callback specified for convar \"%s\"", cvar->GetName());
return; return;
} }
@ -362,4 +362,3 @@ void CConVarManager::OnConVarChanged(ConVar *cvar, const char *oldValue)
fwd->PushString(oldValue); fwd->PushString(oldValue);
fwd->Execute(NULL); fwd->Execute(NULL);
} }

View File

@ -41,7 +41,7 @@ void CDbgReporter::OnContextExecuteError(IPluginContext *ctx, IContextTrace *err
const char *custerr; const char *custerr;
if ((custerr=error->GetCustomErrorString()) != NULL) if ((custerr=error->GetCustomErrorString()) != NULL)
{ {
g_Logger.LogError("[SM] Native \"%s\" reported: \"%s\"", lastname, custerr); g_Logger.LogError("[SM] Native \"%s\" reported: %s", lastname, custerr);
} else { } else {
g_Logger.LogError("[SM] Native \"%s\" encountered a generic error.", lastname); g_Logger.LogError("[SM] Native \"%s\" encountered a generic error.", lastname);
} }

View File

@ -25,7 +25,7 @@ static cell_t sm_CreateConVar(IPluginContext *pContext, const cell_t *params)
// While the engine seems to accept a blank convar name, it causes a crash upon server quit // While the engine seems to accept a blank convar name, it causes a crash upon server quit
if (name == NULL || strcmp(name, "") == 0) if (name == NULL || strcmp(name, "") == 0)
{ {
return pContext->ThrowNativeError("Null or blank convar name is not allowed."); return pContext->ThrowNativeError("Null or blank convar name is not allowed");
} }
pContext->LocalToString(params[2], &defaultVal); pContext->LocalToString(params[2], &defaultVal);